debian-mirror-gitlab/app/assets/javascripts/profile/utils.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
363 B
JavaScript
Raw Normal View History

2023-05-27 22:25:52 +05:30
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;
};