Fix current hour check for uneven timezones

This commit is contained in:
Nicolas Mowen 2024-05-22 09:15:56 -06:00
parent 9652ea9e96
commit 89cc2bc16b

View File

@ -302,5 +302,8 @@ export function getEndOfDayTimestamp(date: Date) {
export function isCurrentHour(timestamp: number) { export function isCurrentHour(timestamp: number) {
const now = new Date(); const now = new Date();
now.setMinutes(0, 0, 0); now.setMinutes(0, 0, 0);
return timestamp > now.getTime() / 1000;
const timeShift = getTimestampOffset(timestamp);
return timestamp > now.getTime() / 1000 + timeShift;
} }