From 7cf2ab7c88f4b6df1fd3065484931983ca7b5ec1 Mon Sep 17 00:00:00 2001 From: shuaiplus <2327005759@qq.com> Date: Fri, 12 Jun 2026 16:41:58 +0800 Subject: [PATCH] feat: add formatDateTime function for improved date handling in SettingsPage --- webapp/src/components/SettingsPage.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webapp/src/components/SettingsPage.tsx b/webapp/src/components/SettingsPage.tsx index 0a5a16f..8de9fe8 100644 --- a/webapp/src/components/SettingsPage.tsx +++ b/webapp/src/components/SettingsPage.tsx @@ -82,6 +82,13 @@ function clearLegacyTotpSetupSecrets(): void { } } +function formatDateTime(value: string | null | undefined): string { + if (!value) return t('txt_dash'); + const date = new Date(value); + if (Number.isNaN(date.getTime())) return t('txt_dash'); + return date.toLocaleString(); +} + export default function SettingsPage(props: SettingsPageProps) { const [currentPassword, setCurrentPassword] = useState(''); const [newPassword, setNewPassword] = useState('');