OAFRONT4 清理PC付款和工作台文案

这个提交包含在:
2026-05-25 07:47:52 +08:00
父节点 7937c76ebd
当前提交 fa5ed0337d
共修改 13 个文件,包含 115 行新增和 48 行删除
+32
查看文件
@@ -0,0 +1,32 @@
export function formatDisplayDate(value: string | null | undefined) {
if (!value) return "-";
const match = /^(\d{4})-(\d{2})-(\d{2})/.exec(value);
if (match) {
const [, year, month, day] = match;
return `${Number(year)}年${Number(month)}月${Number(day)}日`;
}
const timestamp = new Date(value).getTime();
if (Number.isNaN(timestamp)) return "-";
return new Intl.DateTimeFormat("zh-CN", {
year: "numeric",
month: "long",
day: "numeric",
}).format(timestamp);
}
export function formatDisplayDateTime(value: string | null | undefined) {
if (!value) return "-";
const timestamp = new Date(value).getTime();
if (Number.isNaN(timestamp)) return formatDisplayDate(value);
return new Intl.DateTimeFormat("zh-CN", {
year: "numeric",
month: "long",
day: "numeric",
hour: "2-digit",
minute: "2-digit",
}).format(timestamp);
}