Skip to content

Commit

Permalink
bugfix events page date comparison in local time instead of utc
Browse files Browse the repository at this point in the history
  • Loading branch information
antiantivirus committed Oct 10, 2024
1 parent a21132c commit 09d3980
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/eventRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ function EventLink({ event }) {
}

function EventDate(event, expanded = false) {
const start = dayjs(event.date);
const end = dayjs(event.endDate);
const start = dayjs(event.date.replace("Z", ""));
const end = dayjs(event.endDate?.replace("Z", ""));
const isSameDay = start.isSame(end, "day");
const isSameMonth = start.isSame(end, "month");
return (
Expand Down
1 change: 0 additions & 1 deletion pages/events/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export default function NewsPage({
}
if (!reachedPastEvents && dayjs(eventEndDate).isAfter(now)) {
const month = dayjs(event.date).format("MMMM");
console.log(event);
if (uEvents[month]) {
uEvents[month].unshift(event);
} else {
Expand Down

0 comments on commit 09d3980

Please sign in to comment.