( dateAdapter: DateAdapter<D>, activeDate: D, minDate: D | null, maxDate: D | null, )
| 423 | * "startingYear" will render when paged into view. |
| 424 | */ |
| 425 | export 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 |
no test coverage detected