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>
This commit is contained in:
Lucas Bordeau
2024-07-30 14:52:10 +02:00
committed by GitHub
parent 45ebb0b824
commit ccf4d1eeec
64 changed files with 1176 additions and 165 deletions

View File

@ -1,6 +0,0 @@
/**
* Detects the user's time zone.
* @returns a IANA time zone
*/
export const detectTimeZone = () =>
Intl.DateTimeFormat().resolvedOptions().timeZone;

View File

@ -1,10 +0,0 @@
import { AVAILABLE_TIME_ZONE_OPTIONS_BY_LABEL } from '@/settings/accounts/constants/AvailableTimezoneOptionsByLabel';
import { formatTimeZoneLabel } from '@/settings/accounts/utils/formatTimeZoneLabel';
/**
* 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)];