落地正式异常创建/合并、三状态人工处置与控制台,关闭 M06 DONE_LOCAL(含 D40 认领文案「处理」)。 Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
668 B
TypeScript
22 lines
668 B
TypeScript
/**
|
|
* Alarm timestamps for tables. Empty or invalid values stay blank.
|
|
* Boundary: display only. It does not parse filter input.
|
|
* Depends on the browser time zone.
|
|
*/
|
|
|
|
function pad(value: number): string {
|
|
return String(value).padStart(2, "0");
|
|
}
|
|
|
|
/** "2026-11-17 09:12" in the browser's time zone, or "" when unset or invalid. */
|
|
export function formatDateTime(iso: string | null | undefined): string {
|
|
if (!iso) {
|
|
return "";
|
|
}
|
|
const date = new Date(iso);
|
|
if (Number.isNaN(date.getTime())) {
|
|
return "";
|
|
}
|
|
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
}
|