Fix current hour check for uneven timezones (#11484)

This commit is contained in:
Nicolas Mowen 2024-05-22 09:27:00 -06:00 committed by GitHub
parent 9652ea9e96
commit db496ec525
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}