@@ -60,24 +60,24 @@ export class DatepickerDemo {
60
60
`
61
61
} )
62
62
export class CustomHeader {
63
- constructor ( @Host ( ) public calendar : MatCalendar < any > ,
63
+ constructor ( @Host ( ) private _calendar : MatCalendar < any > ,
64
64
private _dateAdapter : DateAdapter < any > ) { }
65
65
66
66
get periodLabel ( ) {
67
- let year = this . _dateAdapter . getYearName ( this . calendar . activeDate ) ;
68
- let month = ( this . _dateAdapter . getMonth ( this . calendar . activeDate ) + 1 ) ;
67
+ let year = this . _dateAdapter . getYearName ( this . _calendar . activeDate ) ;
68
+ let month = ( this . _dateAdapter . getMonth ( this . _calendar . activeDate ) + 1 ) ;
69
69
return `${ month } /${ year } ` ;
70
70
}
71
71
72
72
previousClicked ( mode : 'month' | 'year' ) {
73
- this . calendar . activeDate = mode == 'month' ?
74
- this . _dateAdapter . addCalendarMonths ( this . calendar . activeDate , - 1 ) :
75
- this . _dateAdapter . addCalendarYears ( this . calendar . activeDate , - 1 ) ;
73
+ this . _calendar . activeDate = mode == 'month' ?
74
+ this . _dateAdapter . addCalendarMonths ( this . _calendar . activeDate , - 1 ) :
75
+ this . _dateAdapter . addCalendarYears ( this . _calendar . activeDate , - 1 ) ;
76
76
}
77
77
78
78
nextClicked ( mode : 'month' | 'year' ) {
79
- this . calendar . activeDate = mode == 'month' ?
80
- this . _dateAdapter . addCalendarMonths ( this . calendar . activeDate , 1 ) :
81
- this . _dateAdapter . addCalendarYears ( this . calendar . activeDate , 1 ) ;
79
+ this . _calendar . activeDate = mode == 'month' ?
80
+ this . _dateAdapter . addCalendarMonths ( this . _calendar . activeDate , 1 ) :
81
+ this . _dateAdapter . addCalendarYears ( this . _calendar . activeDate , 1 ) ;
82
82
}
83
83
}
0 commit comments