react-widgets icon indicating copy to clipboard operation
react-widgets copied to clipboard

DateTimePicker always computes time list options based on current minute for current day

Open joelclimbsthings opened this issue 8 years ago • 6 comments

I may be missing something here, but I've looked over the docs pretty thoroughly. I'm using the DateTimePicker and would like the provided list of times to always occur on even 30 minute intervals.

This is the current behavior if you select a day other than the current one, but otherwise it references the current minute and computes the "steps" based on that. ex. (1:18, 1:48, 2:18...) instead of (1:30, 2:00, 2:30...)

Changing the starting value and defaultValue has no impact on this--steps are still based on the current minute.

Is it possible to this currently, or would it require an enhancement?

joelclimbsthings avatar Dec 24 '17 21:12 joelclimbsthings

Sounds like a bug! It should increments from midnight yeah

jquense avatar Dec 24 '17 23:12 jquense

Ah! Yup, definitely something amiss then. Shouldn't be difficult to reproduce, but let me know if I can provide anything more.

joelclimbsthings avatar Dec 27 '17 00:12 joelclimbsthings

hmm sorry I'm not seeing this bug anymore :P is there some way to reproduce it (I remember that i was able to before but can't seem to now)

jquense avatar Feb 08 '18 20:02 jquense

Hey, I was just playing around with the DateTimePicker (looks great by the way) but I am seeing this issue as well. It doesn't appear to happen if you select the calendar first, only if you select the time first. I am using react-widgets-moment for my localizer (dont know if that matters at all). It'd be great to have this fixed.

kimberlymeganJones avatar Jul 12 '18 20:07 kimberlymeganJones

I found a work around for this; if you set the min to a time that is on the step that you want (Aka if you want it on the hour set the minDate to the nearest hour) then it works! hope this helps anyone else stumbles across this!

kimberlymeganJones avatar Jul 19 '18 16:07 kimberlymeganJones

@kimberly-lewelling do you have a example code for this solution?

canoqb10 avatar Aug 20 '20 22:08 canoqb10