File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ <h2>Options</h2>
1111 < input matInput [matDatepicker] ="minDatePicker " [(ngModel)] ="minDate " placeholder ="Min date "
1212 [disabled] ="inputDisabled ">
1313 < 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 >
1515 </ mat-form-field >
1616 < mat-form-field >
1717 < input matInput [matDatepicker] ="maxDatePicker " [(ngModel)] ="maxDate " placeholder ="Max date "
@@ -28,6 +28,14 @@ <h2>Options</h2>
2828 < mat-datepicker #startAtPicker [touchUi] ="touch " [disabled] ="datepickerDisabled "> </ mat-datepicker >
2929 </ mat-form-field >
3030</ 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 >
3139
3240< h2 > Result</ h2 >
3341
Original file line number Diff line number Diff line change @@ -45,21 +45,13 @@ export class DatepickerDemo {
4545 customHeader = CustomHeader ;
4646}
4747
48- // Custom Header Component for DatePicker Calendar
48+ // Custom header component for datepicker
4949@Component ( {
5050 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'
5552} )
5653export class CustomHeader {
5754 constructor ( @Host ( ) public calendar : MatCalendar < any > ,
5855 public adapter : DateAdapter < any > ) {
5956 }
60-
61- convertCalendarFormatTo ( format : string ) {
62-
63- console . log ( format ) ;
64- }
6557}
You can’t perform that action at this time.
0 commit comments