From db496ec52583dd048e3fbdf49a541a0ab49c0bba Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 22 May 2024 09:27:00 -0600 Subject: [PATCH] Fix current hour check for uneven timezones (#11484) --- web/src/utils/dateUtil.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/utils/dateUtil.ts b/web/src/utils/dateUtil.ts index 999e1d211..c9fc511df 100644 --- a/web/src/utils/dateUtil.ts +++ b/web/src/utils/dateUtil.ts @@ -302,5 +302,8 @@ export function getEndOfDayTimestamp(date: Date) { export function isCurrentHour(timestamp: number) { const now = new Date(); now.setMinutes(0, 0, 0); - return timestamp > now.getTime() / 1000; + + const timeShift = getTimestampOffset(timestamp); + + return timestamp > now.getTime() / 1000 + timeShift; }