Simplify timezone math (#11586)

* Use utc minutes

* Cleanup
This commit is contained in:
Nicolas Mowen
2024-05-28 08:09:17 -06:00
committed by GitHub
parent 2fda383782
commit 8546d3d315
4 changed files with 12 additions and 33 deletions

View File

@@ -131,13 +131,12 @@ export function getChunkedTimeDay(timeRange: TimeRange): TimeRange[] {
endOfThisHour.setSeconds(0, 0);
const data: TimeRange[] = [];
const startDay = new Date(timeRange.after * 1000);
startDay.setMinutes(0, 0, 0);
startDay.setUTCMinutes(0, 0, 0);
let start = startDay.getTime() / 1000;
let end = 0;
for (let i = 0; i < 24; i++) {
startDay.setHours(startDay.getHours() + 1, 0, 0, 0);
startDay.setHours(startDay.getHours() + 1);
if (startDay > endOfThisHour) {
break;