After update from version 0.40.0 calendar not update selected date
See original GitHub issueCalendar display old selected date if i put new selected
prop to calendar.
<DatePicker
ref={this.onDatePickerRef}
openToDate={this.state.openDate}
onMonthChange={this.onMonthChange}
customInput={<SelectedDate/>}
popoverTargetOffset='0 0'
dateFormat={isSelectedCurrentYear ? DATE_FORMAT_FOR_CURRENT_YEAR : DATE_FORMAT}
dateFormatCalendar='MMMM'
{...this.props}
selected={this.state.selectedDate}
onChange={this.onSelectedDateChange}
filter={this.datesFilter}
forceShowMonthNavigation={true}
>
<YearsSelector onChange={this.onYearChange} year={this.state.openDate.year()}/>
</DatePicker>
prev selected date 01 april
prev selected date 30 april
How you seen. On filter prop calendar reacts and disable days
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:12 (2 by maintainers)
Top Results From Across the Web
Modified react-datepicker not showing value - Stack Overflow
I've successfully modified the codes but whenever I click on the selected date, it's not showing any date at all. Here's what my...
Read more >shared calender not up to date - Microsoft Q&A
Since Office 2021 we have many complains that shared calender not up to date! users must always update manually - why!
Read more >react-date-picker-field - npm
A simple and reusable datepicker component for React. Latest version: 0.1.2, last published: 5 years ago.
Read more >Release Notes | Mimestream
Labs Snooze feature got disabled on upgrade to 0.40.0 ... Version 0.40.0 ... Windows don't open on macOS Catalina after the beta build...
Read more >Unable to establish secure connection wrong version number
Subscribe to RSS Feed; Mark Topic as New; ... Some servers don't like it if the time is wrong or esp if on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We are seeing something similar in our application.
Perform a click anywhere else on the page will cause the calendar to update correctly.
Steps to reproduce:
Expect: The future date is selected and highlighted
Actual: The calendar switches back to the old date ( but does not highlight it ). Clicking on a different date after this point will only toggle between the last two dates.
Workaround:
Calling
setOpen
after the component has been rendered seems to correctly select the date. This is also happening in theonClickOutside
handler, which explains why clicking anywhere else fixes the issue.@alex-shamshurin So what you are suggesting is that the behaviour on the inline example is intended behaviour?
To be clear I was literally using the component as specified earlier (
<DatePicker inline={true} selected={selectedDate} />
), not settingopenToDate
to any value at all when I ran into this issue.If this is intended I think that the example should be fixed and the documentation should clearly state how
inline
should be used, because at this point even your explanation confuses me on the purpose ofopenToDate
in the context of aninline
calendar.