From a50e45babaee9f6da47ec291a90adb7cc5f0acd1 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Mon, 29 Jun 2026 05:44:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(app):=20=E4=BA=8B=E4=BB=B6=E6=B5=81?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=8A=A0=E4=B8=8A=E6=97=A5=E6=9C=9F=E2=80=94?= =?UTF-8?q?=E2=80=94HH:MM:SS=20=E2=86=92=20MM-DD=20HH:MM:SS=EF=BC=88?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E6=97=B6=E5=8C=BA=EF=BC=8C=E4=BB=85=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=B5=81=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增 DATETIME 格式化器用于 adaptEvent,agent 面板的 TIME 保持不动。 Co-Authored-By: Claude Opus 4.8 --- app/src/adapt.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/adapt.js b/app/src/adapt.js index fd1f59f..cb1e299 100644 --- a/app/src/adapt.js +++ b/app/src/adapt.js @@ -92,6 +92,14 @@ export function adaptApproval(tk, projName) { // ── 事件流 ───────────────────────────────────────────── const TIME = (iso) => { try { return new Date(iso).toTimeString().slice(0, 8); } catch { return ''; } }; +// 事件流时间带日期(本地时区):MM-DD HH:MM:SS +const DATETIME = (iso) => { + try { + const d = new Date(iso); + const p = (n) => String(n).padStart(2, '0'); + return `${p(d.getMonth() + 1)}-${p(d.getDate())} ${TIME(iso)}`; + } catch { return ''; } +}; export function adaptEvent(e) { const p = e.payload || {}; @@ -106,7 +114,7 @@ export function adaptEvent(e) { case 'project.synced': detail = `导入 ${p.created ?? 0} · 完成 ${p.done ?? 0}`; break; default: detail = JSON.stringify(p).slice(0, 80); } - return { type: e.type, time: TIME(e.at), detail }; + return { type: e.type, time: DATETIME(e.at), detail }; } // ── 用量 / 配额 ────────────────────────────────────────