-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
Describe the bug
When typing a date manually, the calendar try to navigate to the date but partial dates give surprising results and the navigation jumps back & forth.
Even when the date is correct, sometimes the calendar shows an incorrect date.
To Reproduce
Steps to reproduce the behavior:
- I'm using the Custom Date Format example: https://reactdatepicker.com/#example-custom-date-format
- Type
2021in the input, it goes to January 2021 - Type
2022in the input, it goes to February 2022 - Type
2027in the input, it goes to July 2027
It looks like the last number of the year is used as the month. I think the view should stay on 1st Jan.
- Type
2027/01, it goes to July 2027 (I expect January here) - Add a
/to get2027/01/and now it goes to January 2027 as expected - Add a
0to get2027/01/0and it goes back to July (I expect to stay on the same view when the date becomes invalid) - Finally add a
1to get a full date2027/01/01- on the site example, it's back on 1st Jan
- but on my pretty minimal codesandbox, it stays on July! https://codesandbox.io/p/sandbox/7hz5dy
Screenshots
If applicable, add screenshots to help explain your problem.
And in my codesandbox, the worst case:
Desktop:
- OS: MacOS
- Browser: Chrome
- Version: 143
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels