fix(dashboard): normalize task modal timestamps to local time#282
Open
luoyanglang wants to merge 1 commit intocft0808:mainfrom
Open
fix(dashboard): normalize task modal timestamps to local time#282luoyanglang wants to merge 1 commit intocft0808:mainfrom
luoyanglang wants to merge 1 commit intocft0808:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue: #277 - 任务详情弹窗内多个时间字段存在时区口径不一致问题
Type: Bug Fix
Severity: Medium
This PR normalizes timestamp parsing inside the task detail modal so all relevant time fields are rendered in the browser's local timezone. It removes the current UTC/local mix across scheduler info, flow log entries, and live activity timestamps.
Root Cause
The task detail modal was using multiple incompatible display paths for the same class of timestamp values:
edict/frontend/src/components/TaskModal.tsx:46fmtActivityTime()returnedts.substring(11, 19)for string timestamps, which displayed raw UTC clock text instead of local time.edict/frontend/src/components/TaskModal.tsx:300lastProgressAt/lastDispatchAt) were rendered via string slicing as well.edict/frontend/src/components/TaskModal.tsx:363dashboard/server.pyalready emits UTC ISO timestamps vianow_iso(), so the data source was mostly consistent; the inconsistency came from the frontend display logic.Fix Description
Changed files:
edict/frontend/src/time.ts:1- add a shared timestamp parser/formatter that normalizes UTC-ish strings and numeric timestamps into browser-local display valuesedict/frontend/src/components/TaskModal.tsx:4- import the shared formatter utilitiesedict/frontend/src/components/TaskModal.tsx:46- route activity timestamps through the shared local formatteredict/frontend/src/components/TaskModal.tsx:300- render scheduler timestamps with unified local datetime formattingedict/frontend/src/components/TaskModal.tsx:363- render flow log timestamps with the same local parsing logicedict/frontend/src/components/TaskModal.tsx:456- align the “最后活跃” summary line with the same formatterWhy this approach:
YYYY-MM-DD HH:mm:ss,HH:mm,HH:mm:ss) while unifying timezone handling.Test Results
npm.cmd installnpm.cmd run buildManual verification target:
最近进展/最近派发, flow log timestamps,最近更新, and activity item timestamps.Disprove Analysis
Is this already fixed elsewhere?
upstream/mainstill contains the string-slicing display paths inTaskModal.tsx.Impact scope
Edge cases
Known limitation
dashboard/dist.Checklist
#277)Found during issue triage and reproduced through code-path inspection of the current dashboard modal. Happy to adjust if you prefer a different timestamp normalization policy.