Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

md-datepicker select the good day but shows an other month when show calendar popup #5640

Closed
gillouxxx opened this issue Jul 10, 2017 · 3 comments
Assignees

Comments

@gillouxxx
Copy link

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When I open the calendar of the datepicker, it needs to show me the month of the selected day.

What is the current behavior?

When I open the calendar, it shows me octobre month instead of July but the day of the 10th of July is selected (today).

What are the steps to reproduce?

Set Windows in French and start the following plnkr :
https://plnkr.co/edit/ucGODHnqlaRi7IgoJNmt?p=preview

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

I am using the version 2.0.0-beta7 of material.

@julianobrasil
Copy link
Contributor

julianobrasil commented Jul 10, 2017

The date adapter was built to be very flexible. The price to pay (very low in my opinion) is that you have to built a DateAdapter class to make it work the way you want.

You can extend and customize the Material provided NativeDateAdapter if you're using the JS Date object. Basically all you want is to parse the date correctly because your locale represent dates differently from MM/dd/yyyy. See the material docs to learn about it (the three or four last topics).

Also see this discussion: #5185

See this plunker for Brazilian Portuguese: http://plnkr.co/edit/jc4Ywu?p=preview

@gillouxxx
Copy link
Author

Ok thank you. Everything is working now.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants