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

Datepicker doesn't use locale if user write date in input #8929

Closed
rbleuse opened this issue Dec 11, 2017 · 3 comments
Closed

Datepicker doesn't use locale if user write date in input #8929

rbleuse opened this issue Dec 11, 2017 · 3 comments

Comments

@rbleuse
Copy link

rbleuse commented Dec 11, 2017

Bug, feature request, or proposal:

The datepicker component doesn't use locale if the user writes the date directly in the input, without choosing date from calendar popup

What is the expected behavior?

The date should be parsed with the locale set up in module

What is the current behavior?

The date uses the default locale

What are the steps to reproduce?

Here is a stackblitz with french locale :
https://stackblitz.com/edit/angular-material2-issue-rb6xvc?file=app/app.component.ts

Select a date from the calendar in the first datepicker
Validate first date picker
Then copy paste the date in the second
Validate the second date picker

If you choose 01/02/2018 (1st of february), you get these result :
first : Thu Feb 01 2018 00:00:00 GMT+0100 (Paris, Madrid)
second : Tue Jan 02 2018 00:00:00 GMT+0100 (Paris, Madrid)

datepicker_bug

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

ng 5.1 / material2 5.0.0

Is there anything else we should know?

@NaifousBS
Copy link

NaifousBS commented Dec 11, 2017

See #7823

Also a stackblitz example with the french locale : https://stackblitz.com/edit/angular-date-picker-sample-fr?file=app%2Fmoment-date-adapter.ts

Edit: adding stackblitz example

@rbleuse
Copy link
Author

rbleuse commented Dec 11, 2017

Yes it works great. Thank you !

@rbleuse rbleuse closed this as completed Dec 11, 2017
@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

2 participants