datepicker: startAt and setting value doesn't work correctly
See original GitHub issuerepro (using mmalerba:dp-a11y):
- predefine value to 2017-05-02 (YYYY-MM-DD), input shows correctly
02/05/2017
- open datepicker, it opens on a wrong month (second, instead of the fifth)
- select 6th day of the second month (that was open), input changes to
06/02/2017
(should have been 06/05/2017) - close and open input again, selected day is set to second of february, but calendar opens at sixth month
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Angular Material Date-Picker is not working properly
I have used material datepicker in angular 7. Go through this and hope it will resolve your issue.
Read more >Datepicker selected value - StackBlitz
can be found in the LICENSE file at http:/ /angular.io/license -->.
Read more >Datepicker | Angular Material - API Manual
The startView property of <mat-datepicker> can be used to set the view that will show up when the calendar first opens. It can...
Read more >Angular Material Datepicker: Complete Guide
Complete guided tour to the Angular Material Datepicker component, from the most commonly used features to the most advanced ones.
Read more >Datepicker in Angular using mat-datepicker | Material Design
By default when we open calender pop up it will show the current month calender. Instead of that if we want to set...
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
Found a simple workaround that works for my use-case. I set the
startAt
property to the date i provide asngModel
. Now (using german locale) the datepicker will open at the correct month.I cannot understand how you guys from material are not providing at least one MomentDateAdapter, so that everyone can use a basic version of i18nalized date-pickers. I know there are ways to implement it, but only supporting
MM-DD-YYYY
out of the box is not enough.