mui-x
mui-x copied to clipboard
[pickers] Ineffective Date and Time Validation Despite minTime, maxTime, and disableIgnoringDatePartForTimeValidation Settings
Search Keywords
datetimepicker, validation, issue
Latest Version
- [X] I have tested this on the latest version.
Steps to Reproduce
Link to a live example: LiveDemo
Steps:
- Open the provided example.
- Review the parameters.
- Notice that setting
disableIgnoringDatePartForTimeValidation
to true appears ineffective.
Current Behavior
Enabling disableIgnoringDatePartForTimeValidation
should ensure the date portion is considered during validation. However, it appears to be disregarded. When accessing the picker, it's evident that dates prior to the specified minTime
are not disabled as expected. Furthermore, both the parameter and the validation process require correction, as disableIgnoringDatePartForTimeValidation
currently does not produce the intended effect.
Expected Behavior
Setting a minTime
or maxTime
should result in the disabling of dates preceding the minTime
and subsequent to the maxTime
. Additionally, enabling disableIgnoringDatePartForTimeValidation
is expected to incorporate the date into the validation process, taking both date and time into consideration.
Context
I aimed to limit the date selection using minTime
and maxTime
and to utilize their validation capabilities. Regrettably, this approach has proven ineffective. I have implemented disableIgnoringDatePartForTimeValidation
to no avail.
Your Environment
No response
Order ID or Support Key 💳 (Optional)
No response
Hi,
Did you try using minDateTime
and maxDateTime
?
IMHO disableIgnoringDatePartForTimeValidation
should not be part of the public API, you should always be able to use minTime
/ maxTime
if you don't want to impact the date part and minDateTime
/ maxDateTime
if you do want to impact it.
The issue has been inactive for 7 days and has been automatically closed.