[Bug] Datepicker shows incorrect month
See original GitHub issueBug, feature request, or proposal:
Bug.
What is the expected behavior?
The datepicker should open at the correct month.
What is the current behavior?
Datepicker doesn’t display the correct month if you use a custom locale like this: this.dateAdapter.setLocale('pt-BR');
and select a day lower than 13.
What are the steps to reproduce?
Select a day lower than 13 and open the datepicker again.
Providing a Plunker (or similar) is the best way to get the team to see your issue. https://plnkr.co/edit/gkYoHKauuzfvtRDMmwtl?p=info
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular: 4.1.3 Material: 2.0.0-beta.6 Browsers: Chrome (I only tested on this).
Is there anything else we should know?
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Datepicker Is Returning Wrong Month (showing the month selec
Actual behavior When I click on a date, the correct day number and year are put into the field, but the month is...
Read more >bootstrap-datepicker shows the wrong month (month select)
it works fine, but when I selects a month (E.g May) it shows the selected month as March. (2 months back), Always there...
Read more >Solved: Issue with Date Picker "month of May" dates showin...
It beautifully displays all selected dates in the correct format (e.g. Apr-03-2020), except for dates within the month of May! In May, the...
Read more >jquery ui datepicker showing wrong date — DataTables forums
I want to use the jquery UI datepicker in this case as it is more customizable.(I only want the user to select month/year...
Read more >Wrong Month or Year Shown in Date Picker | Jira
When user try to select the Date Started in the Log Work action, the date picker automatically show wrong previous or future month/year....
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
Take a look at this plunker, it’s working: https://plnkr.co/edit/FlgGpjqyDlypas0VZJzo?p=preview
As you extends the NativeDateAdapter, it’s just one tiny class overriding the parser function. In fact there’s no need to specify the constants as the setLocale takes care of it.
@julianobrasil - 😃. it’s my bad. I am in a time crunch and my mind is not functioning properly. Thanks so much for your help. this is the best solution.