DatePicker with MAT_DATE_LOCALE = en-GB parses incorrectly if the day is changed?
See original GitHub issueBug:
With DatePicker, in the NgModule, I have the following settings:
providers: [{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' },
{ provide: LOCALE_ID, useValue: "en-GB" },
If I input a string like “10/12/2017”, the picker will has 12 Oct 2017 selected, instead of 10 Dec 2017 since en-GB should use DD/MM/YYYY.
Others features of the DatePicker are working fine.
What are the steps to reproduce?
In the plnkr example provided at https://material.angular.io/components/datepicker/overview, in main.ts, just add settings to NgModule:
providers: [{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' },
{ provide: LOCALE_ID, useValue: "en-GB" },
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 4.4.4, Material: Beta 12.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:16 (2 by maintainers)
Top Results From Across the Web
day incorrect in angular material datepicker - Stack Overflow
When a user type date in text box instead of choosing date with datepicker then his code does't work it reduce one day...
Read more >Datepicker - Angular Material
The datepicker allows users to enter a date either through text input, or by choosing a date from the calendar. It is made...
Read more >DateTime picker displays incorrect format for our region
The date picker always returns and displays as mm/dd/yyyy I have set DateTimeZone to local and I've set the regional setting in SharePoint...
Read more >Angular Material Datepicker : Set Locale - ConcretePage.com
Set Locale in Application Module using MAT_DATE_LOCALE. The default locale of Datepicker is changed by overriding the value of MAT_DATE_LOCALE .
Read more >day incorrect in angular material datepicker - iTecNote
Angular – day incorrect in angular material datepicker. angularangular-material2datepicker. When I select a date I see the correct date in the field but, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 as Iuqeckr
I changed this moment date adapter a bit. This works for me:
And don’t forget to update main application module with providers: