Update schedule:

Removes all spaces from the values [ 1000] -> [1000]
This commit is contained in:
marmei
2019-08-04 09:49:51 +02:00
parent 8490187d31
commit 50e6ed274e

View File

@@ -37,17 +37,25 @@ func updateServerSettings(request RequestStruct) (settings SettingsStrcut, err e
reloadData = true reloadData = true
case "update": case "update":
// Die Formatierung der Uhrzeit überprüfen (0000 - 2359) // Leerzeichen aus den Werten entfernen und Formatierung der Uhrzeit überprüfen (0000 - 2359)
for _, i := range newSettings[key].([]interface{}) { var newUpdateTimes []string
_, err := time.Parse("1504", i.(string)) for _, v := range value.([]interface{}) {
v = strings.Replace(v.(string), " ", "", -1)
_, err := time.Parse("1504", v.(string))
if err != nil { if err != nil {
ShowError(err, 1012) ShowError(err, 1012)
return Settings, err return Settings, err
} }
newUpdateTimes = append(newUpdateTimes, v.(string))
} }
value = newUpdateTimes
case "cache.images": case "cache.images":
cacheImages = true cacheImages = true