-
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 timepicker stepMinute should show zero-based multiples of step #2301
Comments
Hi @jamesmcglinn,
I like it ;) Could you please create a PR? Thanks a lot @jamesmcglinn ;) |
PR Submitted |
Hey, it seems that this is still an issue with primereact (tested on 8.0.0 & 8.7.2). I have yet to test it with the new release. For now, I handled it by manually updating the view date, but I will be happy to revisit it when I have time and submit a PR if necessary. Here is a fork from the examples page with stepMinute set to 30 > https://codesandbox.io/s/withered-cdn-gedup5 |
@MNazakov it looks like its working to me? It bounced you back and forth between 12:30 and 12:00 ? That is expected for |
Hi @melloware, thanks for the reply, as far as I understand from the OP, the issue is that the default value is wrong ( when calendar is shown )
The problem is the initial value. For example if the current time is 15:53 and stepMinute is set to 30 the initial time shown in the date picker will be 15:53 and will change to 16:00 for up button ( or 15:30 if the user has pressed the down button ) only after the interaction has happened. This means that the user has can submit the time with an invalid value depending on the use-case. Please let me know if I misunderstood the OP's issue description, or if what I'm saying is not related to it Thanks! |
ahh yes its not checking the initial minute. I just opened a new ticket: #3770 |
@melloware thanks! I will be happy to look into it and create a PR as soon as I have some spare time to get familiar with the current implementation. Cheers! |
I fixed it! It will be in 8.7.4 |
I'm submitting a ... (check one with "x")
Codesandbox Case (Bug Reports)
Please fork the codesandbox below and create a case demonstrating your bug report. Issues without a codesandbox have much less possibility to be reviewed.
https://codesandbox.io/s/primereact-test-forked-lsctl
Current behavior
When using the Calendar timepicker's stepMinute prop the default value's minutes are the exact current time, regardless of whether the current time minutes are a multiple of stepMinute.
Expected behavior
The default value should have minutes set to a multiple of the stepMinute prop.
This has already been fixed in primefaces and primevue:
primefaces/primefaces#6047
primefaces/primevue#115
I'm happy to create a PR with the same changes if you'd like.
Minimal reproduction of the problem with instructions
https://codesandbox.io/s/primereact-test-forked-lsctl
To reproduce open the codesandbox when the current time isn't on the hour, or 20/40 minutes past the hour. At all other times it will default to the current time, and the increment/decrement minute buttons will add/subtract 20 minutes from the arbitrary current time.
Please tell us about your environment:
https://codesandbox.io/s/primereact-test-forked-lsctl
React version:
17.0.2
PrimeReact version:
6.5.1
Browser:
All
Language:
All
The text was updated successfully, but these errors were encountered: