You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a DateTimePicker value starts with a null date, the calendar drop down shows the current month, but the user cannot navigate months until a date is selected. Then the the user can click previous and next months.
The text was updated successfully, but these errors were encountered:
I finally figured this out, though I don't have a good solution.
When the value is null, the DateTimePicker passes a new Date object to the Calendar widget. For some reason with the way my app is set up, whenever I clicked to navigate right or left, it updated the value so a new Date object was created, which caused this line to trigger in Calendar.js:
//if the value changes reset views to the new oneif(!dates.eq(val,this.props.value,VIEW_UNIT[view]))this.setState({currentDate: val})
This would reset the state to the new value, so it would never navigate right or left. As soon as it had an actual value, then it wouldn't create a new Date, so the value wouldn't be different, so it wouldn't be triggered.
UPDATE: Just figured it out. I added an onClick function to my component, and stopped event propagation.
When a DateTimePicker value starts with a null date, the calendar drop down shows the current month, but the user cannot navigate months until a date is selected. Then the the user can click previous and next months.
The text was updated successfully, but these errors were encountered: