question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Datepicker shows incorrect month

See original GitHub issue

Bug, 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:closed
  • Created 6 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
julianobrasilcommented, Jun 4, 2017

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.

1reaction
playground0076commented, Jun 16, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found