From 2f661239bcf8e3061cc993109732ae76b03fa019 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Thu, 5 Feb 2026 09:37:15 +0000 Subject: [PATCH] Few little fixes and tweaks --- src/components/common/DateView.tsx | 25 +++++++++++++++++++------ src/i18n/generatedLocales.ts | 2 ++ src/modules/errorLogs/errorLogs.tsx | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/components/common/DateView.tsx b/src/components/common/DateView.tsx index 1a5bc62..e7559fd 100644 --- a/src/components/common/DateView.tsx +++ b/src/components/common/DateView.tsx @@ -1,9 +1,22 @@ -interface DateViewProps{ - value : Date; +import { getCurrentUser } from "../../modules/frame/services/authenticationService"; + +interface DateViewProps { + value: Date; } -export function DateView( props: DateViewProps) : JSX.Element { - const options : Intl.DateTimeFormatOptions = { year: '2-digit', month: 'short', day: 'numeric', hour12:true, hour:"2-digit", minute:"2-digit" }; +export function DateView(props: DateViewProps): JSX.Element { + const options: Intl.DateTimeFormatOptions = { + year: "2-digit", + month: "short", + day: "2-digit", + hour12: false, + hour: "2-digit", + minute: "2-digit", + }; - return <>{props.value.toLocaleString(undefined,options)} -} \ No newline at end of file + const currentuser = getCurrentUser(); + + return ( + <>{props.value.toLocaleString(currentuser?.preferredLocale, options)} + ); +} diff --git a/src/i18n/generatedLocales.ts b/src/i18n/generatedLocales.ts index a8c1fd7..e09eba4 100644 --- a/src/i18n/generatedLocales.ts +++ b/src/i18n/generatedLocales.ts @@ -28,6 +28,7 @@ export const availableLocales = [ export const baseLocales = [ "en", + "es", "fr", "ur" ] as const; @@ -40,6 +41,7 @@ export const fallbackLng = { "en" ], "es-ES": [ + "es", "en" ], "fr-CA": [ diff --git a/src/modules/errorLogs/errorLogs.tsx b/src/modules/errorLogs/errorLogs.tsx index 4fa88de..496206f 100644 --- a/src/modules/errorLogs/errorLogs.tsx +++ b/src/modules/errorLogs/errorLogs.tsx @@ -16,7 +16,7 @@ const ErrorLogs = (): JSX.Element => { data: [], }); const [sortColumn, setSortColumn] = useState>({ - key: "Id", + key: "id", label: t("Id"), order: "desc", });