File tree Expand file tree Collapse file tree
src/material-luxon-adapter/adapter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99import { NgModule , Provider } from '@angular/core' ;
1010import { DateAdapter , MAT_DATE_FORMATS , MatDateFormats } from '@angular/material/core' ;
11- import { LuxonDateAdapter } from './luxon-date-adapter' ;
11+ import {
12+ LuxonDateAdapter ,
13+ MAT_LUXON_DATE_ADAPTER_OPTIONS ,
14+ MatLuxonDateAdapterOptions ,
15+ } from './luxon-date-adapter' ;
1216import { MAT_LUXON_DATE_FORMATS } from './luxon-date-formats' ;
1317
1418export * from './luxon-date-adapter' ;
@@ -31,12 +35,19 @@ export class MatLuxonDateModule {}
3135
3236export function provideLuxonDateAdapter (
3337 formats : MatDateFormats = MAT_LUXON_DATE_FORMATS ,
38+ options ?: MatLuxonDateAdapterOptions ,
3439) : Provider [ ] {
35- return [
40+ const providers : Provider [ ] = [
3641 {
3742 provide : DateAdapter ,
3843 useClass : LuxonDateAdapter ,
3944 } ,
4045 { provide : MAT_DATE_FORMATS , useValue : formats } ,
4146 ] ;
47+
48+ if ( options ) {
49+ providers . push ( { provide : MAT_LUXON_DATE_ADAPTER_OPTIONS , useValue : options } ) ;
50+ }
51+
52+ return providers ;
4253}
You can’t perform that action at this time.
0 commit comments