File tree 2 files changed +11
-11
lines changed 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ <h2>Options</h2>
11
11
< input matInput [matDatepicker] ="minDatePicker " [(ngModel)] ="minDate " placeholder ="Min date "
12
12
[disabled] ="inputDisabled ">
13
13
< mat-datepicker-toggle matSuffix [for] ="minDatePicker "> </ mat-datepicker-toggle >
14
- < mat-datepicker #minDatePicker [touchUi] ="touch " [disabled] ="datepickerDisabled " [calendarHeaderComponent] =" customHeader " > </ mat-datepicker >
14
+ < mat-datepicker #minDatePicker [touchUi] ="touch " [disabled] ="datepickerDisabled "> </ mat-datepicker >
15
15
</ mat-form-field >
16
16
< mat-form-field >
17
17
< input matInput [matDatepicker] ="maxDatePicker " [(ngModel)] ="maxDate " placeholder ="Max date "
@@ -28,6 +28,14 @@ <h2>Options</h2>
28
28
< mat-datepicker #startAtPicker [touchUi] ="touch " [disabled] ="datepickerDisabled "> </ mat-datepicker >
29
29
</ mat-form-field >
30
30
</ p >
31
+ < p >
32
+ < mat-form-field >
33
+ < input matInput [matDatepicker] ="customCalendarHeaderPicker " placeholder ="Custom calendar header "
34
+ [disabled] ="inputDisabled ">
35
+ < mat-datepicker-toggle matSuffix [for] ="customCalendarHeaderPicker "> </ mat-datepicker-toggle >
36
+ < mat-datepicker #customCalendarHeaderPicker [touchUi] ="touch " [disabled] ="datepickerDisabled " [calendarHeaderComponent] ="customHeader "> </ mat-datepicker >
37
+ </ mat-form-field >
38
+ </ p >
31
39
32
40
< h2 > Result</ h2 >
33
41
Original file line number Diff line number Diff line change @@ -45,21 +45,13 @@ export class DatepickerDemo {
45
45
customHeader = CustomHeader ;
46
46
}
47
47
48
- // Custom Header Component for DatePicker Calendar
48
+ // Custom header component for datepicker
49
49
@Component ( {
50
50
selector : 'custom-header' ,
51
- template : `<select (change)="convertCalendarFormatTo($event.target.value)">
52
- <option>Gregorian</option>
53
- <option>Julian</option>
54
- </select>`
51
+ template : 'custom header'
55
52
} )
56
53
export class CustomHeader {
57
54
constructor ( @Host ( ) public calendar : MatCalendar < any > ,
58
55
public adapter : DateAdapter < any > ) {
59
56
}
60
-
61
- convertCalendarFormatTo ( format : string ) {
62
-
63
- console . log ( format ) ;
64
- }
65
57
}
You can’t perform that action at this time.
0 commit comments