Initializes this month view.
()
| 398 | |
| 399 | /** Initializes this month view. */ |
| 400 | _init() { |
| 401 | this._setRanges(this.selected); |
| 402 | this._todayDate.set(this._getCellCompareValue(this._dateAdapter.today())); |
| 403 | this._monthLabel.set( |
| 404 | this._dateFormats.display.monthLabel |
| 405 | ? this._dateAdapter.format(this.activeDate, this._dateFormats.display.monthLabel) |
| 406 | : this._dateAdapter |
| 407 | .getMonthNames('short') |
| 408 | [this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase(), |
| 409 | ); |
| 410 | |
| 411 | let firstOfMonth = this._dateAdapter.createDate( |
| 412 | this._dateAdapter.getYear(this.activeDate), |
| 413 | this._dateAdapter.getMonth(this.activeDate), |
| 414 | 1, |
| 415 | ); |
| 416 | this._firstWeekOffset.set( |
| 417 | (DAYS_PER_WEEK + |
| 418 | this._dateAdapter.getDayOfWeek(firstOfMonth) - |
| 419 | this._dateAdapter.getFirstDayOfWeek()) % |
| 420 | DAYS_PER_WEEK, |
| 421 | ); |
| 422 | |
| 423 | this._initWeekdays(); |
| 424 | this._createWeekCells(); |
| 425 | this._changeDetectorRef.markForCheck(); |
| 426 | } |
| 427 | |
| 428 | /** Focuses the active cell after the microtask queue is empty. */ |
| 429 | _focusActiveCell(movePreview?: boolean) { |
no test coverage detected