mui-x
mui-x copied to clipboard
[pickers] Ensuring Comprehensive Validation for Date and DateTime Range Fields
Search Keywords
daterange, datetimerange, range validation, bug
Latest Version
- [X] Tested on the latest version
Steps to Reproduce
Link to live example: Live Demo
Steps:
- Set a
minDate
for a DateRange or DateTimeRange. - Choose a start value with at least
minDate
set and leaveendDate
blank. - The field appears valid. However, for a range, both a
startDate
and anendDate
are required, making the field invalid. This error should also be triggered on change invalidationError
.
Current Behavior
Currently, setting a startDate
correctly validates the minDate
and maxDate
, except when an endDate
is not specified, leading to incorrect validation that marks the field as valid.
Expected Behavior
Setting a startDate
without specifying an endDate
should result in an invalid field due to the missing endDate
. It should also adhere to minDate
and maxDate
validations. A range requires both values, not just one.
Context
Ensuring correct validation for Date-Range or DateTime-Range fields.
Your Environment
No response
Order ID or Support Key 💳 (optional)
No response