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

Method _createCellForMonth

src/material/datepicker/year-view.ts:352–364  ·  view source on GitHub ↗

Creates an MatCalendarCell for the given month.

(month: number, monthName: string)

Source from the content-addressed store, hash-verified

350
351 /** Creates an MatCalendarCell for the given month. */
352 private _createCellForMonth(month: number, monthName: string) {
353 const date = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1);
354 const ariaLabel = this._dateAdapter.format(date, this._dateFormats.display.monthYearA11yLabel);
355 const cellClasses = this.dateClass ? this.dateClass(date, 'year') : undefined;
356
357 return new MatCalendarCell(
358 month,
359 monthName.toLocaleUpperCase(),
360 ariaLabel,
361 this._shouldEnableMonth(month),
362 cellClasses,
363 );
364 }
365
366 /** Whether the given month is enabled. */
367 private _shouldEnableMonth(month: number) {

Callers 1

_initMethod · 0.95

Calls 4

_shouldEnableMonthMethod · 0.95
createDateMethod · 0.45
getYearMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected