In the Date Range Picker, users should not be able to select any date in the future; future dates must be disabled.

This commit is contained in:
Kartik sharma 2025-07-11 16:25:03 +05:30
parent 6dc6ee6f3c
commit a73ac284bd

View File

@ -27,6 +27,7 @@ const DateRangePicker = ({
defaultDate: [startDate, endDate], defaultDate: [startDate, endDate],
static: true, static: true,
clickOpens: true, clickOpens: true,
maxDate: endDate, // Disable future dates
onChange: (selectedDates, dateStr) => { onChange: (selectedDates, dateStr) => {
const [startDateString, endDateString] = dateStr.split(" to "); const [startDateString, endDateString] = dateStr.split(" to ");
onRangeChange?.({ startDate: startDateString, endDate: endDateString }); onRangeChange?.({ startDate: startDateString, endDate: endDateString });