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

Method _getCellCompareValue

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

Gets the value that will be used to one cell to another.

(date: D | null)

Source from the content-addressed store, hash-verified

578
579 /** Gets the value that will be used to one cell to another. */
580 private _getCellCompareValue(date: D | null): number | null {
581 if (date) {
582 // We use the time since the Unix epoch to compare dates in this view, rather than the
583 // cell values, because we need to support ranges that span across multiple months/years.
584 const year = this._dateAdapter.getYear(date);
585 const month = this._dateAdapter.getMonth(date);
586 const day = this._dateAdapter.getDate(date);
587 return new Date(year, month, day).getTime();
588 }
589
590 return null;
591 }
592
593 /** Determines whether the user has the RTL layout direction. */
594 private _isRtl() {

Callers 4

_initMethod · 0.95
_previewChangedMethod · 0.95
_createWeekCellsMethod · 0.95
_setRangesMethod · 0.95

Calls 3

getYearMethod · 0.45
getMonthMethod · 0.45
getDateMethod · 0.45

Tested by

no test coverage detected