From 735ac5af6b2382be0c55b2e1bc5079434d91c250 Mon Sep 17 00:00:00 2001 From: ZhaiSoul <842607283@qq.com> Date: Mon, 12 Jan 2026 14:39:08 +0800 Subject: [PATCH] fix: fix AM/PM i18n display issue --- web/src/utils/dateUtil.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/utils/dateUtil.ts b/web/src/utils/dateUtil.ts index b007a9573..cc541214c 100644 --- a/web/src/utils/dateUtil.ts +++ b/web/src/utils/dateUtil.ts @@ -165,7 +165,7 @@ export const formatUnixTimestampToDateTime = ( // Uppercase AM/PM for 12-hour formats if (date_format.includes("a") || date_format.includes("aaa")) { formatted = formatted.replace(/am|pm/gi, (match) => - match.toUpperCase(), + i18n.t(`time.${match.toLowerCase()}`, { ns: "common" }).toUpperCase(), ); } return formatted; @@ -217,7 +217,7 @@ export const formatUnixTimestampToDateTime = ( // Uppercase AM/PM in fallback if (options.hour12) { fallbackFormatted = fallbackFormatted.replace(/am|pm/gi, (match) => - match.toUpperCase(), + i18n.t(`time.${match.toLowerCase()}`, { ns: "common" }).toUpperCase(), ); } return fallbackFormatted;