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

@ -26,7 +26,8 @@ const DateRangePicker = ({
altFormat: "d-m-Y",
defaultDate: [startDate, endDate],
static: true,
clickOpens: true,
clickOpens: true,
maxDate: endDate, // Disable future dates
onChange: (selectedDates, dateStr) => {
const [startDateString, endDateString] = dateStr.split(" to ");
onRangeChange?.({ startDate: startDateString, endDate: endDateString });
@ -54,4 +55,4 @@ const DateRangePicker = ({
);
};
export default DateRangePicker;
export default DateRangePicker;