This commit is contained in:
2026-05-06 00:10:45 +08:00
parent 2e3eb4b8f8
commit 916a4f5ffc
19 changed files with 2431 additions and 723 deletions
+20
View File
@@ -0,0 +1,20 @@
export function formatLocalDateTime(value: string | null | undefined, fallback = "无") {
if (!value) {
return fallback;
}
const date = new Date(value);
if (Number.isNaN(date.getTime())) {
return fallback;
}
return new Intl.DateTimeFormat("zh-CN", {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
hour12: false,
}).format(date);
}