Skip to content

Commit

Permalink
fix: use UTC date for calendar filter (#4046)
Browse files Browse the repository at this point in the history
  • Loading branch information
RoccoSmit authored Oct 23, 2024
1 parent 7e48d13 commit 2851f11
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ const Home = () => {
} else if (filter.factor === "property.hasCode") {
filters.push(`has_code == true`);
} else if (filter.factor === "displayTime") {
const timestampAfter = new Date(filter.value).getTime() / 1000;
const filterDate = new Date(filter.value);
const filterUtcTimestamp = filterDate.getTime() + filterDate.getTimezoneOffset() * 60 * 1000;
const timestampAfter = filterUtcTimestamp / 1000;
filters.push(`display_time_after == ${timestampAfter}`);
filters.push(`display_time_before == ${timestampAfter + 60 * 60 * 24}`);
}
Expand Down

0 comments on commit 2851f11

Please sign in to comment.