Add schema validation and sync metadata UI

This commit is contained in:
SepComet
2026-05-06 09:47:00 +08:00
parent e03af0c800
commit 85e510fbc0
14 changed files with 474 additions and 126 deletions
+28
View File
@@ -0,0 +1,28 @@
export function formatDateTime(value?: string) {
if (!value) {
return '';
}
const time = Date.parse(value);
if (Number.isNaN(time)) {
return value;
}
return new Intl.DateTimeFormat('zh-CN', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
hour12: false,
}).format(new Date(time));
}
export function getLatestDate(values: string[]) {
const timestamps = values.map((value) => Date.parse(value)).filter((value) => !Number.isNaN(value));
if (timestamps.length === 0) {
return '';
}
return new Date(Math.max(...timestamps)).toISOString();
}