From 2ffe5194780a454739573e335d177ca925fdbfac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tha=C3=AFs?= Date: Wed, 27 Mar 2024 15:17:31 +0100 Subject: [PATCH] feat: add date format calendar setting (#4600) Closes #4184 --- ...ttingsAccountsCalendarDateFormatSelect.tsx | 34 +++++++++++++++ ...ettingsAccountsCalendarDisplaySettings.tsx | 32 +++++++------- ...ttingsAccountsCalendarTimeFormatSelect.tsx | 42 +++++++++++++++++++ .../settings/accounts/constants/DateFormat.ts | 4 ++ .../settings/accounts/constants/TimeFormat.ts | 4 ++ 5 files changed, 99 insertions(+), 17 deletions(-) create mode 100644 packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarDateFormatSelect.tsx create mode 100644 packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarTimeFormatSelect.tsx create mode 100644 packages/twenty-front/src/modules/settings/accounts/constants/DateFormat.ts create mode 100644 packages/twenty-front/src/modules/settings/accounts/constants/TimeFormat.ts diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarDateFormatSelect.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarDateFormatSelect.tsx new file mode 100644 index 000000000..278af533e --- /dev/null +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarDateFormatSelect.tsx @@ -0,0 +1,34 @@ +import { formatInTimeZone } from 'date-fns-tz'; + +import { DateFormat } from '@/settings/accounts/constants/DateFormat'; +import { Select } from '@/ui/input/components/Select'; + +type SettingsAccountsCalendarDateFormatSelectProps = { + value: DateFormat; + onChange: (nextValue: DateFormat) => void; + timeZone: string; +}; + +export const SettingsAccountsCalendarDateFormatSelect = ({ + onChange, + timeZone, + value, +}: SettingsAccountsCalendarDateFormatSelectProps) => ( + + ); diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarTimeFormatSelect.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarTimeFormatSelect.tsx new file mode 100644 index 000000000..cab95257d --- /dev/null +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarTimeFormatSelect.tsx @@ -0,0 +1,42 @@ +import { formatInTimeZone } from 'date-fns-tz'; + +import { TimeFormat } from '@/settings/accounts/constants/TimeFormat'; +import { Select } from '@/ui/input/components/Select'; + +type SettingsAccountsCalendarTimeFormatSelectProps = { + value: TimeFormat; + onChange: (nextValue: TimeFormat) => void; + timeZone: string; +}; + +export const SettingsAccountsCalendarTimeFormatSelect = ({ + onChange, + timeZone, + value, +}: SettingsAccountsCalendarTimeFormatSelectProps) => ( +