-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Calendar: AM/PM does not work properly if minDate and maxDate validations are provided as prop #6151
Comments
Hello @melloware , have checked the code and seems like issue is within getCurrentDateTime() function which we are calling to store the currentTime and currentHour. `
` So as a workaround if am changing this parameter !(currentHour > 11) to (currentHour > 11) in validateHour conditional check , then the maxDate validation is working as expected. But the main issues lies in getCurrentDateTime() fn as we need to return the props.value same as the value which we are selecting in time picker, but its the other way around, the value we are getting is the previous one, ie toggling AM/PM for 2 PM gives 2 AM and vice versa. `
` |
@shubhsaur feel free to submit a PR. |
Co-authored-by: Shubham Saurabh <[email protected]>
Describe the bug
When we are using minDate and maxDate validation as prop in the two separate input (which is shown in the demo as From and To fields), then changing the AM to PM does not work. The detailed steps have been provided below to recreate this issue.
Reproducer
https://stackblitz.com/edit/stackblitz-starters-aemkru?file=src%2FApp.tsx
PrimeReact version
10.5.1
React version
17.x
Language
ES6
Build / Runtime
Create React App (CRA)
Browser(s)
Edge 121
Steps to reproduce the behavior
While changing it to its original state - AM to PM still holds the validation true, that is, the FROM time should be less than TO field max time (02:30 AM / 02:30 PM < 06:30 PM)
Expected behavior
The From field time should be able to change from AM to PM
FROM: 02:30 AM -> 02:30 PM should work if we have provided TO time as 06:30 PM.
The text was updated successfully, but these errors were encountered: