From fe2793dae134b1e07e30670ab9726961d5722efd Mon Sep 17 00:00:00 2001 From: Akshith <33996844+akshith312@users.noreply.github.com> Date: Tue, 24 Feb 2026 21:15:51 -0800 Subject: [PATCH 1/2] fix: fixed event date selector from choosing past date --- .../Reports/Participation/CreateEventModal.jsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/components/CommunityPortal/Reports/Participation/CreateEventModal.jsx b/src/components/CommunityPortal/Reports/Participation/CreateEventModal.jsx index 5707d9a506..f3a47403a5 100644 --- a/src/components/CommunityPortal/Reports/Participation/CreateEventModal.jsx +++ b/src/components/CommunityPortal/Reports/Participation/CreateEventModal.jsx @@ -90,6 +90,16 @@ function CreateEventModal({ isOpen, toggle }) { newErrors.date = 'Date is required'; } + if (formData.date) { + const selectedDate = moment(FormDataEvent.date, 'YYYY-MM-DD').startOf('day'); + const today = moment() + .tz('America/Los_Angeles') + .startOf('day'); + if (selectedDate.isBefore(today)) { + newErrors.date = 'Event Date Cannot be in the past'; + } + } + if (!formData.startTime) { newErrors.startTime = 'Start time is required'; } @@ -273,6 +283,9 @@ function CreateEventModal({ isOpen, toggle }) { value={formData.date} onChange={handleChange} disabled={loading} + min={moment() + .tz('America/Los_Angeles') + .format('YYYY-MM-DD')} style={darkMode ? { colorScheme: 'dark' } : {}} /> {errors.date &&