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:
parent
6dc6ee6f3c
commit
a73ac284bd
@ -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 });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user