[DateRangePicker] Add maxRange
prop
#8868
Labels
component: DateRangePicker
The React component.
component: pickers
This is the name of the generic UI component, not the React module!
enhancement
This is not a bug, nor a new feature
plan: Pro
Impact at least one Pro user
Duplicates
Latest version
Summary 💡
The
DateRangePicker
accepts theminDate
andmaxDate
props but if you want to control these props based on the selected start or end dates, it can be difficult.I think for the
DateRangePicker
component it would make sense to add amaxRange
props which accepts the max range of days accepted.Examples 🌈
For instance, if in the start date the user selects 04/05/2023 and the
maxRange
is 10, theDateRangePicker
should only allow selecting an end date until 14/05/2023.When the date picker is closed and opened again, the limits should be reset so the user can set a new date out of the current limits and the new limit should be calculated based on that new date.
If I want to select a new date after the max limit defined based on the currently selected date, I can't because it is disabled. It is annoying that I have to clear the date, which causes the date picker to close again, open the date picker and select the new date freely.
Motivation 🔦
Allow a
maxRange
to avoid creating a fully controllableDateRangePicker
to also control theminDate
andmaxDate
props.Order ID 💳 (optional)
54728
The text was updated successfully, but these errors were encountered: