mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-11-04 02:40:20 +00:00
feat: add formatDateTime function for improved date handling in SettingsPage
This commit is contained in:
1 parent
1918735520
commit
7cf2ab7c88
1 file changed
+7
@@ -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('');
|
||||
|
||||
Reference in new issue
Block a user