Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typing bug with dateformat #5175

Open
dmaggiore-sorint opened this issue Oct 18, 2024 · 3 comments
Open

Typing bug with dateformat #5175

dmaggiore-sorint opened this issue Oct 18, 2024 · 3 comments

Comments

@dmaggiore-sorint
Copy link

Describe the bug
When typing a date without zeros and with a 2digit year, when the day is smaller than 13, it invert the day and the month even though the dateFormat is "dd/MM/yyyy"

To Reproduce

  1. react-datepicker with dateFormat="dd/MM/yyyy"
  2. type a date like '4/8/24" (4 August 2024)

Expected behavior
I expect to see the date 4th of August 2024 in the Datepicker (and also as value) and not 8th of April 2024

@balajis-qb
Copy link

balajis-qb commented Oct 19, 2024

In the above example instead of typing 4/8/24, if you type 4/8/2024 it's correctly parsing or if you change the date format to dd/MM/yy it's working.

@dmaggiore-sorint
Copy link
Author

Ok it works with "dd/MM/yy" but then it doesn't work if the user tyèes 4/8/2024 thinking about 4th August instead of 8th of April.

We need to keep the dateFormat in the "dd/MM/yyyy" way and make 4/8/24 work aswell

@balajis-qb
Copy link

Hi @martijnrusschen, do you have any thoughts on this issue? I feel as the date format mentioned is not insync with the entered date value, this case is an expected. Let me know if this issue need to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants