UNPKG

@equinor/eds-core-react

Version:

The React implementation of the Equinor Design System

11 lines (9 loc) 316 B
const TOTAL_VISIBLE_YEARS = 36; const RANGE_OFFSET = 30 / 2; const getPageYears = (selectedYear, yearPickerPage = 0) => { const page = yearPickerPage * TOTAL_VISIBLE_YEARS; return Array.from({ length: TOTAL_VISIBLE_YEARS }, (_, i) => i + (selectedYear + page - RANGE_OFFSET)); }; export { getPageYears };