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
2021 in the input, it goes to January 2021
- Type
2022 in the input, it goes to February 2022
- Type
2027 in 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 get 2027/01/ and now it goes to January 2027 as expected
- Add a
0 to get 2027/01/0 and it goes back to July (I expect to stay on the same view when the date becomes invalid)
- Finally add a
1 to get a full date 2027/01/01
Screenshots
If applicable, add screenshots to help explain your problem.
And in my codesandbox, the worst case:
Desktop:
- OS: MacOS
- Browser: Chrome
- Version: 143
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:
2021in the input, it goes to January 20212022in the input, it goes to February 20222027in the input, it goes to July 2027It looks like the last number of the year is used as the month. I think the view should stay on 1st Jan.
2027/01, it goes to July 2027 (I expect January here)/to get2027/01/and now it goes to January 2027 as expected0to get2027/01/0and it goes back to July (I expect to stay on the same view when the date becomes invalid)1to get a full date2027/01/01Screenshots
If applicable, add screenshots to help explain your problem.
And in my codesandbox, the worst case:
Desktop: