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

Method _initWeekdays

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

Initializes the weekdays.

()

Source from the content-addressed store, hash-verified

501
502 /** Initializes the weekdays. */
503 private _initWeekdays() {
504 const firstDayOfWeek = this._dateAdapter.getFirstDayOfWeek();
505 const narrowWeekdays = this._dateAdapter.getDayOfWeekNames('narrow');
506 const longWeekdays = this._dateAdapter.getDayOfWeekNames('long');
507
508 // Rotate the labels for days of the week based on the configured first day of the week.
509 const weekdays = longWeekdays.map((long, i) => {
510 return {long, narrow: narrowWeekdays[i], id: uniqueIdCounter++};
511 });
512 this._weekdays.set(weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek)));
513 }
514
515 /** Creates MatCalendarCells for the dates in this month. */
516 private _createWeekCells() {

Callers 1

_initMethod · 0.95

Calls 3

setMethod · 0.80
getFirstDayOfWeekMethod · 0.45
getDayOfWeekNamesMethod · 0.45

Tested by

no test coverage detected