Skip to content

Commit

Permalink
Fix current hour check for uneven timezones (#11484)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 authored May 22, 2024
1 parent 9652ea9 commit db496ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/src/utils/dateUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit db496ec

Please sign in to comment.