Files
twenty/packages/twenty-front/src/modules/localization/utils/findAvailableTimeZoneOption.ts
T
Lucas Bordeau ccf4d1eeec Date formatting per workspace member settings (#6408)
Implement date formatting per workspace member settings

We'll need another round to maybe initialize all workspaces on the
default settings.

For now the default behavior is to take system settings if nothing is
found in DB.

---------

Co-authored-by: Weiko <corentin@twenty.com>
2024-07-30 14:52:10 +02:00

11 lines
548 B
TypeScript

import { formatTimeZoneLabel } from '@/localization/utils/formatTimeZoneLabel';
import { AVAILABLE_TIME_ZONE_OPTIONS_BY_LABEL } from '@/settings/accounts/constants/AvailableTimezoneOptionsByLabel';
/**
* Finds the matching available IANA time zone select option from a given IANA time zone.
* @param value the IANA time zone to match
* @returns the matching available IANA time zone select option or undefined
*/
export const findAvailableTimeZoneOption = (value: string) =>
AVAILABLE_TIME_ZONE_OPTIONS_BY_LABEL[formatTimeZoneLabel(value)];