-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
md-datepicker uses wrong formats #4862
Comments
Plunkr of the issue: This only seems to happen when the DateAdapter's locale is not For now, my only solution is to force |
You can write your own custom adapter, as @mmalerba explains in #4736:
|
I cant seem to get a custom adapter to work. Thanks |
Unfortunately no(t here). Let's keep GitHub issues for bug reports / feature requests. Better avenues for troubleshooting / questions are Stack Overflow, gitter, mailing list, etc. |
I've written a MomentJS adapter that seems to work. At least, it's capable of parsing localized dates, as long as they are the same locale, of course. It's not fully tested. I work for a company where don't like to spend time writing unit tests (yeah, we live on the edge). Do you think it worth for me to do a pull request? Or maybe I should send the files/patch to someone? Or maybe you have already written it and only needs to be merged to master branch? |
@mestremuten We're currently messing with our packaging structure, we need to get it so that adding a Moment.js adapter doesn't force a dependency on Moment.js even for people who are not using it. Closing since this issue seems to be about the native |
@Kyderman, take a look at this: #4955 (comment) |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug
What is the expected behavior?
When selecting a date like e.g. the 4. May and then reopening the datepicker it should still interpret it as the 4. May and not the 5. April.
What is the current behavior?
When opening the the datepicker and selecting the 4. May the input will display the date 4.5.2017. When reopening the datepicker it will display the month view of April while still selecting the 4. May.
What are the steps to reproduce?
Open the official example for the datepicker in Chrome Datepicker component page and select a date where the date value is not equal to the month and doesn't exceed 12. Then reopen the datepicker and look what month is open
What is the use-case or motivation for changing an existing behavior?
The current behaviour is plain wrong as the day is interpreted as month which will confuse users immensly.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
I'm using Angular 4.1.3 + Angular material 2.0.0-beta6 but judging from the fact that even the official example is affected it is likely visible in all versions of material in which the datepicker is included.
Chrome 58.0.3029.110 is affected while Firefox 53.0.3 and IE 11 are fine
Is there anything else we should know?
It's possible that this is only visible in countries which don't use a MM.DD but instead a DD.MM format
The text was updated successfully, but these errors were encountered: