Merge pull request 'In the Date Range Picker, users should not be able to select any date in the future; future dates must be disabled.' (#250) from Kartik_Bug#730 into Issues_July_2W

Reviewed-on: #250
Merged
This commit is contained in:
pramod.mahajan 2025-07-11 11:06:53 +00:00
commit a14f2b0738

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 });