Initializes this year view.
()
| 292 | |
| 293 | /** Initializes this year view. */ |
| 294 | _init() { |
| 295 | this._setSelectedMonth(this.selected); |
| 296 | this._todayMonth.set(this._getMonthInCurrentYear(this._dateAdapter.today())); |
| 297 | this._yearLabel.set(this._dateAdapter.getYearName(this.activeDate)); |
| 298 | |
| 299 | let monthNames = this._dateAdapter.getMonthNames('short'); |
| 300 | // First row of months only contains 5 elements so we can fit the year label on the same row. |
| 301 | this._months.set( |
| 302 | [ |
| 303 | [0, 1, 2, 3], |
| 304 | [4, 5, 6, 7], |
| 305 | [8, 9, 10, 11], |
| 306 | ].map(row => row.map(month => this._createCellForMonth(month, monthNames[month]))), |
| 307 | ); |
| 308 | this._changeDetectorRef.markForCheck(); |
| 309 | } |
| 310 | |
| 311 | /** Focuses the active cell after the microtask queue is empty. */ |
| 312 | _focusActiveCell() { |
no test coverage detected