debian-mirror-gitlab/spec/frontend/deploy_freeze/helpers.js

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

11 lines
508 B
JavaScript
Raw Normal View History

2021-11-18 22:05:49 +05:30
import freezePeriodsFixture from 'test_fixtures/api/freeze-periods/freeze_periods.json';
import timezoneDataFixture from 'test_fixtures/timezones/short.json';
2021-01-29 00:20:46 +05:30
import { secondsToHours } from '~/lib/utils/datetime_utility';
2021-11-18 22:05:49 +05:30
export { freezePeriodsFixture, timezoneDataFixture };
2021-01-29 00:20:46 +05:30
export const findTzByName = (identifier = '') =>
timezoneDataFixture.find(({ name }) => name.toLowerCase() === identifier.toLowerCase());
export const formatTz = ({ offset, name }) => `[UTC ${secondsToHours(offset)}] ${name}`;