-
Notifications
You must be signed in to change notification settings - Fork 18
How to set locale #33
Comments
As it seems the locale is actually only interpreted by the original mat-datepicker but, but not by the timepicker extension. |
@breitembach @jrauschenbusch you need to provide a Custom
and it works in the same way as the official Intl class, but following this interface: |
@matheo If you only want to localize the labels and messages of the datepicker, then you're right. See But if you want to localize the date format it should be sufficient to import the MatMomentDateModule and to set the locale as desired. One of the following approaches should then be sufficient to change to date format of an Either on module level: or dynamically on component level: constructor(private dateAdapter: DateAdapter<Date>) {
dateAdapter.setLocale('de-DE')
} This is currently not the case. Instead the following function is called 2 times. One time with a _datepicker.type MatDatepickerInput.prototype._formatValue = function (value) {
var type = this._datepicker.type;
this._elementRef.nativeElement.value = value
? this._dateAdapter.format(value, this._dateFormats.display[type])
: '';
}; Additionally the value of this._dateFormats.display[type] should be |
how i can set another locale please?
The text was updated successfully, but these errors were encountered: