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

Method _getMonthInCurrentYear

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

* Gets the month in this year that the given Date falls on. * Returns null if the given Date is in another year.

(date: D | null)

Source from the content-addressed store, hash-verified

323 * Returns null if the given Date is in another year.
324 */
325 private _getMonthInCurrentYear(date: D | null) {
326 return date && this._dateAdapter.getYear(date) == this._dateAdapter.getYear(this.activeDate)
327 ? this._dateAdapter.getMonth(date)
328 : null;
329 }
330
331 /**
332 * Takes a month and returns a new date in the same day and year as the currently active date.

Callers 2

_initMethod · 0.95
_setSelectedMonthMethod · 0.95

Calls 2

getYearMethod · 0.45
getMonthMethod · 0.45

Tested by

no test coverage detected