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}`;
|