From f73d57841c4d18bbc4b373b9b5605ad401c04580 Mon Sep 17 00:00:00 2001 From: somramnani Date: Fri, 10 Apr 2026 18:07:03 -0400 Subject: [PATCH] fix(datePicker): fix error in datePicker --- src/components/CommunityPortal/CPDashboard.jsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/CommunityPortal/CPDashboard.jsx b/src/components/CommunityPortal/CPDashboard.jsx index 9b9eaff87f..33e688c794 100644 --- a/src/components/CommunityPortal/CPDashboard.jsx +++ b/src/components/CommunityPortal/CPDashboard.jsx @@ -96,15 +96,22 @@ export function CPDashboard() { }); const handleDateChange = date => { + if (!date) { + setSelectedDate(''); + return; + } + const today = new Date(); - today.setHours(0, 0, 0, 0); // midnight today + today.setHours(0, 0, 0, 0); if (date < today) { toast.error('Past dates are not supported. Please select a future date.'); setSelectedDate(''); return; } - setSelectedDate(date); + + const formatted = date.toISOString().split('T')[0]; + setSelectedDate(formatted); }; const FALLBACK_IMG =