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

Function getActiveOffset

src/material/datepicker/multi-year-view.ts:425–433  ·  view source on GitHub ↗
(
  dateAdapter: DateAdapter<D>,
  activeDate: D,
  minDate: D | null,
  maxDate: D | null,
)

Source from the content-addressed store, hash-verified

423 * "startingYear" will render when paged into view.
424 */
425export function getActiveOffset<D>(
426 dateAdapter: DateAdapter<D>,
427 activeDate: D,
428 minDate: D | null,
429 maxDate: D | null,
430): number {
431 const activeYear = dateAdapter.getYear(activeDate);
432 return euclideanModulo(activeYear - getStartingYear(dateAdapter, minDate, maxDate), yearsPerPage);
433}
434
435/**
436 * We pick a "starting" year such that either the maximum year would be at the end

Callers 4

_initMethod · 0.85
_getActiveCellMethod · 0.85

Calls 3

euclideanModuloFunction · 0.85
getStartingYearFunction · 0.85
getYearMethod · 0.45

Tested by

no test coverage detected