DocSpace-buildtools/packages/components/calendar/utils/getCalendarYears.js
2023-02-05 15:40:12 +05:00

12 lines
274 B
JavaScript

export const getCalendarYears = (observedDate) => {
const years = [];
const selectedYear = observedDate.year();
const firstYear = selectedYear - (selectedYear % 10) - 1;
for (let i = firstYear; i <= firstYear + 15; i++) {
years.push(i);
}
return years;
};