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>
18 lines
538 B
TypeScript
18 lines
538 B
TypeScript
import { DateFormat } from '@/localization/constants/DateFormat';
|
|
import { TimeFormat } from '@/localization/constants/TimeFormat';
|
|
import { detectTimeZone } from '@/localization/utils/detectTimeZone';
|
|
import { createState } from 'twenty-ui';
|
|
|
|
export const dateTimeFormatState = createState<{
|
|
timeZone: string;
|
|
dateFormat: DateFormat;
|
|
timeFormat: TimeFormat;
|
|
}>({
|
|
key: 'dateTimeFormatState',
|
|
defaultValue: {
|
|
timeZone: detectTimeZone(),
|
|
dateFormat: DateFormat.MONTH_FIRST,
|
|
timeFormat: TimeFormat['HOUR_24'],
|
|
},
|
|
});
|