Skip to content

Commit

Permalink
fix start and end of day when there is daylight saving
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdallatif committed Mar 11, 2020
1 parent b656daa commit 53af057
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/utility/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function iterateTimes(start, end, unit, timeSteps, callback) {
}

while (time.valueOf() < end) {
let nextTime = moment(time).add(timeSteps[unit] || 1, `${unit}s`)
let nextTime = moment(time).add(timeSteps[unit] || 1, `${unit}s`).startOf(unit);
callback(time, nextTime)
time = nextTime
}
Expand Down

0 comments on commit 53af057

Please sign in to comment.