MCPcopy Create free account
hub / github.com/angular/components / _init

Method _init

src/material/datepicker/month-view.ts:400–426  ·  view source on GitHub ↗

Initializes this month view.

()

Source from the content-addressed store, hash-verified

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) {

Callers 2

activeDateMethod · 0.95
ngAfterContentInitMethod · 0.95

Calls 14

_setRangesMethod · 0.95
_getCellCompareValueMethod · 0.95
_initWeekdaysMethod · 0.95
_createWeekCellsMethod · 0.95
setMethod · 0.80
markForCheckMethod · 0.80
todayMethod · 0.45
formatMethod · 0.45
getMonthNamesMethod · 0.45
getMonthMethod · 0.45
createDateMethod · 0.45
getYearMethod · 0.45

Tested by

no test coverage detected