Skip to content
Snippets Groups Projects

Move OnCall Schedules timezone to the shared Timezone Dropdown

All threads resolved!
Files
4
@@ -2,30 +2,12 @@ import * as cssVariables from '@gitlab/ui/scss_to_js/scss_variables';
import { startCase } from 'lodash';
import { darkModeEnabled } from '~/lib/utils/color_utils';
import { newDateAsLocaleTime } from '~/lib/utils/datetime_utility';
import { sprintf, __ } from '~/locale';
import {
ASSIGNEE_COLORS_COMBO,
LIGHT_TO_DARK_MODE_SHADE_MAPPING,
NON_ACTIVE_PARTICIPANT_STYLE,
} from '../constants';
/**
* Returns formatted timezone string, e.g. (UTC-09:00) AKST Alaska
*
* @param {Object} tz
* @param {String} tz.name
* @param {String} tz.formatted_offset
* @param {String} tz.abbr
*
* @returns {String}
*/
export const getFormattedTimezone = (tz) => {
return sprintf(__('(UTC %{offset}) %{timezone}'), {
offset: tz.formatted_offset,
timezone: `${tz.abbr} ${tz.name}`,
});
};
/**
* Returns `true` for non-empty string, otherwise returns `false`
*
Loading