Update isPastEvent to consider events one day ahead
Modify isPastEvent function to check if the event is more than one day in the future.
This commit is contained in:
@@ -54,8 +54,12 @@
|
|||||||
|
|
||||||
const isPastEvent = (dateString: string): boolean => {
|
const isPastEvent = (dateString: string): boolean => {
|
||||||
const eventDate = parseEventDate(dateString);
|
const eventDate = parseEventDate(dateString);
|
||||||
const now = new Date();
|
// Add 1 day to the event date
|
||||||
return eventDate < now;
|
const eventDatePlusOneDay = new Date(eventDate.getTime() + 24 * 60 * 60 * 1000);
|
||||||
|
|
||||||
|
return now > eventDatePlusOneDay;
|
||||||
|
// const now = new Date();
|
||||||
|
// return eventDate < now;
|
||||||
};
|
};
|
||||||
|
|
||||||
const filtered = $derived((events ?? []).filter(matchCategory));
|
const filtered = $derived((events ?? []).filter(matchCategory));
|
||||||
|
|||||||
Reference in New Issue
Block a user