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

Material 2 datepicker not working with el-GR locale #7383

Closed
gtzinos opened this issue Sep 28, 2017 · 4 comments
Closed

Material 2 datepicker not working with el-GR locale #7383

gtzinos opened this issue Sep 28, 2017 · 4 comments

Comments

@gtzinos
Copy link
Contributor

gtzinos commented Sep 28, 2017

Hi guys,

I am trying to set a locale in my datepicker but i am facing an issue. When someone select a date it display the correct format in my input field (dd/mm/yyyy) but when he tries to change the date it can't parse the date to start from the selected month instead it displays the current month. *if i will remove my locale it works fine but i need it.

An example:

User select 09/05/2017 (datepicker locale = el-GR) (dd/mm/yyyy from locale)
input field now has 09/05/2017
User click to change the date and the datepicker opens at september (it can't parse the previous to start from june).

I am using material-beta-10, currently can't upgrade to beta-11 to test your upgrade, so any workaround to keep my locale ?

@fxck
Copy link
Contributor

fxck commented Sep 28, 2017

#4358 and all the other related issues

@julianobrasil
Copy link
Contributor

julianobrasil commented Sep 28, 2017

@gtzinos, if you just want to represent the date correctly in dd/mm/yyyy, one approach is to work with MdMomentDateModule (which is temporarily bugged but it already has a fix on the way).

The other approach is work with regular javascript Date objects and use the MdNativeDateModule. In this case, you'll have to override its parse function building a custom date adapter: https://plnkr.co/edit/Z9JAiP?p=preview

@josephperrott
Copy link
Member

To properly handle dd/mm/yyyy format you will need to use the MomentDateAdapter you can check in with #7262 for status of the adapter.

@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

4 participants