mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
fix: critical infinite loop at the date of switch to daylight saving time
This commit is contained in:
@ -292,9 +292,9 @@ func generateDays(from, to time.Time) []time.Time {
|
||||
days := make([]time.Time, 0)
|
||||
|
||||
from = utils.StartOfDay(from)
|
||||
to = utils.StartOfDay(to.Add(24 * time.Hour))
|
||||
to = utils.StartOfDay(to.AddDate(0, 0, 1))
|
||||
|
||||
for d := from; d.Before(to); d = d.Add(24 * time.Hour) {
|
||||
for d := from; d.Before(to); d = d.AddDate(0, 0, 1) {
|
||||
days = append(days, d)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user