-
-
Notifications
You must be signed in to change notification settings - Fork 330
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
[Calendar] Fix broken dates when keyboard typed #995
Conversation
🤔 Isn't the change assuming the provided text is always in "wrong" order when monthFirst = false? It would exchange those two values all the time. I think adopting something like the following tiny but effective method is suitable |
For users who use the "dd/mm/yyyy" format, they'll type as it, so the date will be always be corrected for them. People that use I know that it's not the best solution, but write a brand new date parser, which will handle all dates specificities (timezones, format...), will need a heavy reflection (and we must not forget that calendar can also handle minutes, month and years only). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I also changed the jsfiddle with a new one to prove the dot usage is also fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi, I tested the jsFiddle https://jsfiddle.net/z6ghfcv9/, but its failing as in lubber_de's gif. It picks 12th of october if a dot is used as seperator |
@PhilippGrashoff |
Description
This PR aim to fix (or at least drastically reduce) the broken date format when it's typed through keyboard. It's a bit hacky, since it only reverse supposed days and month when the setting
monthFirst
is defined totrue
, but I think this little piece of code will cover 98% of cases.Testcase
Before: JSFiddle
After: JSFiddle
Closes
#829
#986