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

Method _hasSameMonthAndYear

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

Checks whether the 2 dates are non-null and fall within the same month of the same year.

(d1: D | null, d2: D | null)

Source from the content-addressed store, hash-verified

568
569 /** Checks whether the 2 dates are non-null and fall within the same month of the same year. */
570 private _hasSameMonthAndYear(d1: D | null, d2: D | null): boolean {
571 return !!(
572 d1 &&
573 d2 &&
574 this._dateAdapter.getMonth(d1) == this._dateAdapter.getMonth(d2) &&
575 this._dateAdapter.getYear(d1) == this._dateAdapter.getYear(d2)
576 );
577 }
578
579 /** Gets the value that will be used to one cell to another. */
580 private _getCellCompareValue(date: D | null): number | null {

Callers 2

activeDateMethod · 0.95

Calls 2

getMonthMethod · 0.45
getYearMethod · 0.45

Tested by

no test coverage detected