fix(datepicker): add back MAT_DATE_LOCALE_PROVIDER (#10602)

This commit is contained in:
mmalerba
2018-03-29 11:14:30 -07:00
committed by Joey Perrott
parent 63f713f846
commit 7fd7ad3ab2
+8 -1
View File
@@ -9,13 +9,20 @@
import {inject, InjectionToken, LOCALE_ID} from '@angular/core';
import {Observable, Subject} from 'rxjs';
/** InjectionToken for datepicker that can be used to override default locale code. */
export const MAT_DATE_LOCALE = new InjectionToken<string>('MAT_DATE_LOCALE', {
providedIn: 'root',
factory: () => inject(LOCALE_ID)
});
/**
* No longer needed since MAT_DATE_LOCALE has been changed to a scoped injectable.
* If you are importing and providing this in your code you can simply remove it.
* @deprecated
* @deletion-target 7.0.0
*/
export const MAT_DATE_LOCALE_PROVIDER = {provide: MAT_DATE_LOCALE, useExisting: LOCALE_ID};
/** Adapts type `D` to be usable as a date by cdk-based components that work with dates. */
export abstract class DateAdapter<D> {
/** The locale to use for all dates. */