-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[Bug] Datepicker showed date is not the same format as written #5700
Comments
This is not a bug. You must build a custom date adapter if your locale date format is different from MM/dd/yyyy. Take a look at this plunk for brazilian portuguese (same date format as you want): https://plnkr.co/edit/jPZWMB?p=preview Also it's explained in more details over here. |
What @julianobrasil said |
That doesn't help. It's not posible override a private function. Class 'CustomDateAdapter' incorrectly extends base class 'NativeDateAdapter'. Types have separate declarations of a private property '_createDateWithOverflow'. |
@raugaral, the When you extends a class (or implements an interface), it's not forbbiden to create your own private/public functions. You're not restricted to override/implement the functions of the superclass/interface. But I think the real confusion here is about what is being done. You don't have to extend NativeDateAdapter to customize the datepicker's formats. What you must do is implement the I'll modify the plunk's date adapter to avoid this confusion in the future. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug
What is the expected behavior?
Select a date using the calendar, show date format dd/mm/yyyy.
Written date using format dd/mm/yyyy should be accepted.
What is the current behavior?
Written date using format dd/mm/yyyy is not accepted, the only valid format is mm/dd/yyy.
What are the steps to reproduce?
At the docs website.
![image](https://user-images.githubusercontent.com/1770795/28106846-ca4aab28-66e5-11e7-8d9c-7d4090ed78a9.png)
![image](https://user-images.githubusercontent.com/1770795/28106879-e04b16ba-66e5-11e7-9b55-0b1c9fbe653f.png)
Select a date in the calendar, the format is dd/mm/yyyy. That is correct.
But, if i write a date manually, the date is not in accepted as valid and the ngModel is empty.
![image](https://user-images.githubusercontent.com/1770795/28106943-118f5970-66e6-11e7-8d5c-6f97c45407a6.png)
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 4.2.6
@angular/[email protected]
[email protected]
OS: Ubuntu 17.04
Google Chrome 59.0.3071.115 (Build oficial) (64 bits)
Is there anything else we should know?
I'm using the locale id de-DE in my app module
{ provide: LOCALE_ID, useValue: "de-DE" }
The text was updated successfully, but these errors were encountered: