debian-mirror-gitlab/app/assets/javascripts/profile/utils.js
2023-05-27 22:25:52 +05:30

13 lines
363 B
JavaScript

import {
OVERVIEW_CALENDAR_BREAKPOINT,
CALENDAR_PERIOD_6_MONTHS,
CALENDAR_PERIOD_12_MONTHS,
} from './constants';
export const getVisibleCalendarPeriod = (calendarContainer) => {
const { width } = calendarContainer.getBoundingClientRect();
return width < OVERVIEW_CALENDAR_BREAKPOINT
? CALENDAR_PERIOD_6_MONTHS
: CALENDAR_PERIOD_12_MONTHS;
};