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 6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
- import { PlatformModule } from '@angular/cdk/platform' ;
10
9
import { NgModule } from '@angular/core' ;
11
10
import { DateAdapter , MAT_DATE_LOCALE_PROVIDER } from './date-adapter' ;
12
11
import { MAT_DATE_FORMATS } from './date-formats' ;
@@ -20,7 +19,6 @@ export * from './native-date-formats';
20
19
21
20
22
21
@NgModule ( {
23
- imports : [ PlatformModule ] ,
24
22
providers : [
25
23
{ provide : DateAdapter , useClass : NativeDateAdapter } ,
26
24
MAT_DATE_LOCALE_PROVIDER
Original file line number Diff line number Diff line change 6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
- import { Platform } from '@angular/cdk/platform' ;
10
9
import { Inject , Injectable , Optional } from '@angular/core' ;
11
10
import { extendObject } from '../util/object-extend' ;
12
11
import { DateAdapter , MAT_DATE_LOCALE } from './date-adapter' ;
@@ -69,12 +68,15 @@ export class NativeDateAdapter extends DateAdapter<Date> {
69
68
*/
70
69
useUtcForDisplay : boolean ;
71
70
72
- constructor ( @Optional ( ) @Inject ( MAT_DATE_LOCALE ) matDateLocale : string , platform : Platform ) {
71
+ constructor ( @Optional ( ) @Inject ( MAT_DATE_LOCALE ) matDateLocale : string ) {
73
72
super ( ) ;
74
73
super . setLocale ( matDateLocale ) ;
75
74
76
75
// 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 ) ) ;
78
80
}
79
81
80
82
getYear ( date : Date ) : number {
You can’t perform that action at this time.
0 commit comments