The default date was first day of the month when skipping selecting date
This happened when:
- User switch to time view without picking a date
- viewMode was "time" and user selected time without picking a date.
I'm not sure whether this is a bug or not but it makes more sense if the default date is today.
My scenario is most of the time users just need to select a time but they are allow to change the date when they need. And also, default value is not allowed for preventing user from skipping the input.
Now I'm using onFocus to set default date as a workaround.
Hm, not sure if I understand what actually happens. If you could either provide a step-by-step guide or create a demo, that would be very helpful! For demo you can fork this codepen: http://codepen.io/simeg/pen/mEmQmP
Hi @knilink ,
What are you using for the value prop?
Hi @simeg thanks for replying Step to reproduce:
- Assuming today is 02/23/2017.
- Click on react-datetime the date pike shows up and a little blue triangle highlight today's date which is 23rd.
- Click on "12:00 AM" without touching anything else, time picker shows up.
- Selet a time, then the selected datetime will be "02/01/2017 12:00 AM" which is the first day of the month.
In my case, some of the users were confused and though the blue triangle meat selected date or it's today's date by default.
I can verify, this is indeed a bug.
Hello everyone, one other case related to this bug:
- disable some dates for selecting by isValidDate property(for example any date in April disabled)
- change month to some disabled(if you will select April in calendar view - every date is disabled)
- change view to time view
- change time
after time changing we automatically have April 1st selected, but it is disabled date
+1
+1
Did anyone resolve this issue?