Skip to content

fix(ui): transactions table time column shows precise local time (rant 2026-08-24T12:38:44) - #139

Merged
argszero merged 1 commit into
mainfrom
fix/tx-time-precise
Aug 24, 2026
Merged

fix(ui): transactions table time column shows precise local time (rant 2026-08-24T12:38:44)#139
argszero merged 1 commit into
mainfrom
fix/tx-time-precise

Conversation

@argszero

Copy link
Copy Markdown
Owner

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.

  • New fmtPrecise(s) helper: parses backend UTC ISO / legacy YYYY-MM-DD HH:MM:SS (treated as UTC, same convention as timeAgo) and formats as local time to the second; non-standard strings (e.g. visitor mock MM-DD HH:mm) pass through unchanged
  • timeCell(s, precise): with precise=true the exact time becomes the main cell text and the relative time ("3 小时前" / "昨天") moves to the title hover tooltip (swapped)
  • Only the transactions table time column (TX_COLUMNS) uses precise mode; other timeCell users (market listing 上架时间, settings 最近使用) keep relative display unchanged

Cache-bust 20260824-620260824-7.

Tests

  • cargo test 146/146, cargo fmt --check, cargo clippy green
  • node --check + fmtPrecise smoke test: UTC→CST conversion, milliseconds strip, legacy format, mock passthrough, empty — all pass

@argszero
argszero merged commit e731c33 into main Aug 24, 2026
1 check passed
@argszero
argszero deleted the fix/tx-time-precise branch August 24, 2026 04:57
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant