Welcome to mirror list, hosted at ThFree Co, Russian Federation.

utils.js « profile « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5b757120544906cb3c6ad01e6a1f5b1cb0f5b89d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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;
};