Enhance date and time format settings to reflect system preferences (#7274)

Closes https://github.com/twentyhq/twenty/issues/6880

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Angela Li
2024-10-09 11:05:40 -04:00
committed by GitHub
parent b80fa9cf13
commit 28c0b146d4
4 changed files with 43 additions and 16 deletions

View File

@ -5,6 +5,10 @@ export const detectTimeFormat = () => {
const isHour12 = Intl.DateTimeFormat(navigator.language, {
hour: 'numeric',
}).resolvedOptions().hour12;
if (isDefined(isHour12) && isHour12) return TimeFormat.HOUR_12;
if (isDefined(isHour12) && isHour12) {
return TimeFormat.HOUR_12;
}
return TimeFormat.HOUR_24;
};