diff --git a/model/alarm.go b/model/alarm.go index 34f9d51..b6faf47 100644 --- a/model/alarm.go +++ b/model/alarm.go @@ -167,7 +167,7 @@ func (a *AlarmRepeated) FillExcepts(cfg *config.Config, db *LevelDBStorage) erro now := time.Now() for _, exception := range exceptions { - if now.After(time.Time(*exception.Start)) { + if now.After(time.Time(*exception.End)) { continue } @@ -175,7 +175,7 @@ func (a *AlarmRepeated) FillExcepts(cfg *config.Config, db *LevelDBStorage) erro for t := time.Time(*exception.Start); end.After(t); t = t.AddDate(0, 0, 1) { if t.Weekday() == a.Weekday { a.Excepts = append(a.Excepts, time.Date(t.Year(), t.Month(), t.Day(), time.Time(*a.StartTime).Hour(), time.Time(*a.StartTime).Minute(), time.Time(*a.StartTime).Second(), 0, cfg.Timezone.GetLocation())) - t.AddDate(0, 0, 6) + t = t.AddDate(0, 0, 6) } } }