fix(ui): transactions table time column shows precise local time (rant 2026-08-24T12:38:44) - #139
Merged
Merged
Conversation
…t 2026-08-24T12:38:44)
12 tasks
argszero
added a commit
that referenced
this pull request
Sep 14, 2026
#229) `exportTxCsv` wrote the view row's raw `t.time` — the UTC string the API returns, which `txsToView` does not convert — while the table cell renders that same field through `fmtPrecise()` (local time, #139 / rant 2026-08-24T12:38:44). In a UTC+8 session one and the same row therefore reads `23:04` in the table and `15:04` in the exported file (west of Greenwich the sign flips). This is the class of divergence C2054/C2055 already closed for the 点数 column: "the export covers the currently visible rows, so the column must use the same 口径 as the cell — otherwise the screen says -3.7 and the file says 3.7". Fix: print the time column with the very helper that renders the cell (`fmtPrecise(t.time)`) instead of keeping a second copy of "time to string". Verified with a jsdom probe (real ui/index.html + the four scripts, only `fetch` stubbed) that boots three transactions, reads the rendered cell and the bytes of the exported Blob: pre-change red on the time-column assertion only; fixed tree 6/6, in Asia/Shanghai and America/New_York. The probe also asserts the process TZ is not UTC, since under TZ=UTC the two 口径 coincide and the defect is invisible.
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
Transactions table time column now shows precise local time (
YYYY-MM-DD HH:MM:SS, e.g.2026-08-24 12:36:12) instead of relative time ("3 小时前"), per rant 2026-08-24T12:38:44.fmtPrecise(s)helper: parses backend UTC ISO / legacyYYYY-MM-DD HH:MM:SS(treated as UTC, same convention astimeAgo) and formats as local time to the second; non-standard strings (e.g. visitor mockMM-DD HH:mm) pass through unchangedtimeCell(s, precise): withprecise=truethe exact time becomes the main cell text and the relative time ("3 小时前" / "昨天") moves to thetitlehover tooltip (swapped)timecolumn (TX_COLUMNS) uses precise mode; othertimeCellusers (market listing 上架时间, settings 最近使用) keep relative display unchangedCache-bust
20260824-6→20260824-7.Tests
cargo test146/146,cargo fmt --check,cargo clippygreennode --check+ fmtPrecise smoke test: UTC→CST conversion, milliseconds strip, legacy format, mock passthrough, empty — all pass