From e9ada4b42b3c7739ef26b1efea6145198fd9f71a Mon Sep 17 00:00:00 2001 From: chark1es Date: Mon, 17 Feb 2025 02:54:17 -0800 Subject: [PATCH] only past events have files shown --- src/components/dashboard/EventsSection.astro | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/dashboard/EventsSection.astro b/src/components/dashboard/EventsSection.astro index 4f9d274..ae75ade 100644 --- a/src/components/dashboard/EventsSection.astro +++ b/src/components/dashboard/EventsSection.astro @@ -720,6 +720,8 @@ import FilePreview from "./Officer_EventManagement/FilePreview"; const renderEventCard = (event: Event, container: HTMLElement) => { const startDate = new Date(event.start_date); const endDate = new Date(event.end_date); + const now = new Date(); + const isPastEvent = endDate < now; // Store event data in window object with unique ID const eventDataId = `event_${event.id}`; @@ -771,7 +773,9 @@ import FilePreview from "./Officer_EventManagement/FilePreview"; ${event.location} ${ - event.files && event.files.length > 0 + isPastEvent && + event.files && + event.files.length > 0 ? `