Skip to content

Commit 25717c4

Browse files
committed
Restrict past date selection in event search calendar
1 parent b70f3ec commit 25717c4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/CommunityPortal/CPDashboard.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ export function CPDashboard() {
77
const [events, setEvents] = useState([]);
88
const [search, setSearch] = useState('');
99

10+
// Get today's date in YYYY-MM-DD format for min date restriction
11+
const today = new Date().toISOString().split('T')[0];
12+
1013
useEffect(() => {
1114
const mockEvents = [
1215
{
@@ -79,7 +82,7 @@ export function CPDashboard() {
7982
<Input type="radio" name="dates" /> This Weekend
8083
</div>
8184
</div>
82-
<Input type="date" placeholder="Ending After" className="date-filter" />
85+
<Input type="date" placeholder="Ending After" className="date-filter" min={today} />
8386
</div>
8487
<div className="filter-item">
8588
<label htmlFor="online-only">Online</label>

0 commit comments

Comments
 (0)