File tree 5 files changed +45
-0
lines changed
5 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 9
9
< div class ="nav-wrapper container ">
10
10
< ul class ="left hide-on-small-only ">
11
11
< li routerLinkActive ="active "> < a [routerLink] ="['simple'] "> Simple</ a > </ li >
12
+ < li routerLinkActive ="active "> < a [routerLink] ="['locale'] "> Locale</ a > </ li >
12
13
< li routerLinkActive ="active "> < a [routerLink] ="['single-datepicker'] "> Single datepicker (fr)</ a > </ li >
13
14
< li routerLinkActive ="active "> < a [routerLink] ="['reactive-forms'] "> Reactive forms</ a > </ li >
14
15
< li routerLinkActive ="active "> < a [routerLink] ="['with-timepicker'] "> With timepicker</ a > </ li >
Original file line number Diff line number Diff line change @@ -21,11 +21,13 @@ import { CustomRangesComponent } from './custom-ranges/custom-ranges.component';
21
21
import { TimepickerComponent } from './timepicker/timepicker.component' ;
22
22
import { ReactiveFormComponent } from './reactive-form/reactive-form.component' ;
23
23
import { MatOptionModule } from '@angular/material/core' ;
24
+ import { LocaleComponent } from './locale/locale.component' ;
24
25
25
26
@NgModule ( {
26
27
declarations : [
27
28
AppComponent ,
28
29
SimpleComponent ,
30
+ LocaleComponent ,
29
31
FullComponent ,
30
32
SingleDatepickerComponent ,
31
33
CustomRangesComponent ,
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { CustomRangesComponent } from './custom-ranges/custom-ranges.component';
5
5
import { SingleDatepickerComponent } from './single-datepicker/single-datepicker.component' ;
6
6
import { TimepickerComponent } from './timepicker/timepicker.component' ;
7
7
import { ReactiveFormComponent } from './reactive-form/reactive-form.component' ;
8
+ import { LocaleComponent } from './locale/locale.component' ;
8
9
9
10
export const appRoutes : Routes = [
10
11
{
@@ -16,6 +17,10 @@ export const appRoutes: Routes = [
16
17
path : 'simple' ,
17
18
component : SimpleComponent
18
19
} ,
20
+ {
21
+ path : 'locale' ,
22
+ component : LocaleComponent
23
+ } ,
19
24
{
20
25
path : 'single-datepicker' ,
21
26
component : SingleDatepickerComponent
Original file line number Diff line number Diff line change
1
+ < mat-toolbar > Locale daterangepicker</ mat-toolbar >
2
+ < div class ="row ">
3
+ < div class ="col s6 ">
4
+ < input
5
+ type ="text "
6
+ ngxDaterangepickerMd
7
+ [(ngModel)] ="selected "
8
+ class ="form-control "
9
+ placeholder ="Choose date "
10
+ [locale] ="{ locale, applyLabel: 'Ack' } " />
11
+ </ div >
12
+ < div class ="col s6 right-align ">
13
+ < select >
14
+ < option value ="fr "> French</ option >
15
+ < option value ="en "> English</ option >
16
+ </ select >
17
+ </ div >
18
+ </ div >
Original file line number Diff line number Diff line change
1
+ import * as fr from 'dayjs/locale/fr'
2
+ import { Component , OnInit , ViewChild } from '@angular/core' ;
3
+ import dayjs from 'dayjs/esm' ;
4
+ dayjs . locale ( fr ) ;
5
+ import utc from 'dayjs/esm/plugin/utc' ;
6
+ dayjs . extend ( utc ) ;
7
+
8
+ @Component ( {
9
+ // eslint-disable-next-line @angular-eslint/component-selector
10
+ selector : 'locale' ,
11
+ templateUrl : './locale.component.html'
12
+ } )
13
+ export class LocaleComponent implements OnInit {
14
+ selected : { startDate : dayjs . Dayjs ; endDate : dayjs . Dayjs } ;
15
+ locale = fr ;
16
+ constructor ( ) { }
17
+
18
+ ngOnInit ( ) : void { }
19
+ }
You can’t perform that action at this time.
0 commit comments