-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: datetime max and min do not consider time when showDefaultButtons={true} #26146
Comments
Thanks for the report and apologies for the delay. Does this issue still happen on the latest version of Ionic (v6.3.3 as of writing)? Also, can you please clarify what the expected behavior is here? |
I can confirm that the issue still happens in Ionic 6.3.3. I have updated the Ionic version in the Codesanbox included in my initial post. The expected behavior is that time values in For instance, in the example in the Codesandbox the parameters are the following:
Date restriction is correctly applied, I cannot select any day before 2022-09-18 or after 2022-10-21. This problem does not appear if showDefaultButtons={false}. |
Thanks! I can reproduce this behavior. |
Hey there, Here is a dev build with a proposed fix if you are interested in testing it:
|
Thanks for the issue. This has been resolved via #26257, and a fix will be available in an upcoming release of Ionic Framework. Please feel free to continue testing the dev build, and let me know if you run into any issues. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
Current Behavior
If option showDefaultButtons={true} is included in IonDatetime, attributes max and min stop working correctly.
Only date is considered, time is not taking into account to set min and max selectable values.
If option showDefaultButtons={true} is commented out, attributes max and min work fine for date and time.
Expected Behavior
Attributtes min and max of IonDatetime should work correctly when option showDefaultButtons={true} is included.
Steps to Reproduce
Comment out line showDefaultButtons={true} (line 48) and repeat the steps above.
Time restrictions imposed by max and min attributes are now working fine.
Code Reproduction URL
https://codesandbox.io/s/ionic6-datetime-and-react-hook-form-me36n2
Ionic Info
ionic info
Ionic:
Ionic CLI : 6.6.0 (C:\Users\MyUser\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/react 6.2.9
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v16.15.1 (C:\Program Files\nodejs\node.exe)
npm : 8.12.2
OS : Windows 10
Additional Information
No response
The text was updated successfully, but these errors were encountered: