-
Notifications
You must be signed in to change notification settings - Fork 162
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
Question: DateTimePicker - Is there a way to use setLocale
like the native Angular Material Date Picker?
#173
Comments
Just a guess: Are you using the "correct" DateAdapter? The code below works fine for me and also appears to work when the locale is changed outside of the constructor (I created a quick and dirty red div with a click listener to try it out). constructor(private adapter: NgxMatDateAdapter<Date>) {
adapter.setLocale('de-DE');
} The import is import {NgxMatDateAdapter} from '@angular-material-components/datetime-picker'; |
In where should I do this? |
I think this thread should be closed. I resolved the same problem with @geisterfurz007 solution. |
added workaround for locale specified in issue h2qutc#173
updated the docs with this workaround in #364, had a hard time implementing custom locales 😿 |
I had an older component that used the Angular Material Date picker. Based on a database value, the locale would be updated for the date picker. Upon installing the Angular Material Components Date Time Picker, this no longer seems to work. As a test i created a method to try and manually call the locale change:
This doesn't work. Is there a way to change the locale of the DateTimePicker? I'm not using moment js within my application. Any assistance would be greatly appreciated.
The text was updated successfully, but these errors were encountered: