You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The datepicker component in the official example should be able to parse the selected date consistently.
What is the current behavior?
Depending on the browser's locale (mine is "en-gb") it sometimes mixes up month and day components. E.g. you select "June 1", then open selector again and now it shows "January 6".
What are the steps to reproduce?
Configure your browser so that new Date().toLocaleString() returns a string in this format 01/07/2017, 14:00:00 (day first).
Open selector again, note that the date became "January 6"
What is the use-case or motivation for changing an existing behavior?
I want to make it clear that this issue is specifically about fixing the documentation/example so it is consistent independent of the browser configuration one uses. I know that there are similar issues where people have problems with their apps, but this is specifically about fixing the documentation.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Tested on Firefox 54.0 with whatever version of Angular/Material that is used in the official documentation.
The text was updated successfully, but these errors were encountered:
The NativeDateAdapter doesn't work well for locales other than en-US. I recommend using a custom DateAdapter or waiting for Angular Material's official MomentDateAdapter which will use Moment.js for parsing and formatting dates.
Bug, feature request, or proposal:
Bug
What is the expected behavior?
The datepicker component in the official example should be able to parse the selected date consistently.
What is the current behavior?
Depending on the browser's locale (mine is "en-gb") it sometimes mixes up month and day components. E.g. you select "June 1", then open selector again and now it shows "January 6".
What are the steps to reproduce?
new Date().toLocaleString()
returns a string in this format01/07/2017, 14:00:00
(day first).What is the use-case or motivation for changing an existing behavior?
I want to make it clear that this issue is specifically about fixing the documentation/example so it is consistent independent of the browser configuration one uses. I know that there are similar issues where people have problems with their apps, but this is specifically about fixing the documentation.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Tested on Firefox 54.0 with whatever version of Angular/Material that is used in the official documentation.
The text was updated successfully, but these errors were encountered: