File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 66 * found in the LICENSE file at https://angular.io/license
77 */
88
9- import { PlatformModule } from '@angular/cdk/platform' ;
109import { NgModule } from '@angular/core' ;
1110import { DateAdapter , MAT_DATE_LOCALE_PROVIDER } from './date-adapter' ;
1211import { MAT_DATE_FORMATS } from './date-formats' ;
@@ -20,7 +19,6 @@ export * from './native-date-formats';
2019
2120
2221@NgModule ( {
23- imports : [ PlatformModule ] ,
2422 providers : [
2523 { provide : DateAdapter , useClass : NativeDateAdapter } ,
2624 MAT_DATE_LOCALE_PROVIDER
Original file line number Diff line number Diff line change 66 * found in the LICENSE file at https://angular.io/license
77 */
88
9- import { Platform } from '@angular/cdk/platform' ;
109import { Inject , Injectable , Optional } from '@angular/core' ;
1110import { extendObject } from '../util/object-extend' ;
1211import { DateAdapter , MAT_DATE_LOCALE } from './date-adapter' ;
@@ -69,12 +68,15 @@ export class NativeDateAdapter extends DateAdapter<Date> {
6968 */
7069 useUtcForDisplay : boolean ;
7170
72- constructor ( @Optional ( ) @Inject ( MAT_DATE_LOCALE ) matDateLocale : string , platform : Platform ) {
71+ constructor ( @Optional ( ) @Inject ( MAT_DATE_LOCALE ) matDateLocale : string ) {
7372 super ( ) ;
7473 super . setLocale ( matDateLocale ) ;
7574
7675 // IE does its own time zone correction, so we disable this on IE.
77- this . useUtcForDisplay = ! platform . TRIDENT ;
76+ // TODO(mmalerba): replace with !platform.TRIDENT, logic currently duplicated to avoid breaking
77+ // change from injecting the Platform.
78+ this . useUtcForDisplay = ! ( typeof document === 'object' && ! ! document &&
79+ / ( m s i e | t r i d e n t ) / i. test ( navigator . userAgent ) ) ;
7880 }
7981
8082 getYear ( date : Date ) : number {
You can’t perform that action at this time.
0 commit comments