Repository navigation
Record dates on the tokens, bases, review and rules pages follow the reader's time zone - #1284
Merged
WaylandYang merged 3 commits intoOct 16, 2026
Merged
Conversation
…reader's time zone Signed-off-by: dada-yan <[email protected]>
…cal-time Signed-off-by: dada-yan <[email protected]>
WaylandYang
approved these changes
Oct 16, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thank you. Using the existing localDate and dropping the two ymd slicers is the right fix, and keeping valid_from/valid_to as slices respects the rule in ui/index.tsx that calendar dates have no time zone. The Shanghai fixture shows the bug clearly. A small note: the Kb literal in the test could be cast from { id, name }, since the page reads nothing else from it, and #1131 adds another p.at.slice(0, 10) in Review.tsx that should use localDate once both have landed. Merging.
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.
The tokens, bases, review and rules pages date record moments by slicing the ISO string, which gives the UTC day, not the reader's.
Problem
East of UTC, early-morning records show the previous day; west of UTC, late-evening ones show the next day.
On dev 15fd7d5, a reader in Shanghai creates a 30-day token at 07:30 on 16 October (
2026-10-15T23:30Z). The tokens page lists it as created 2026-10-15 and expiring 2026-11-14, though it works until 07:30 on 15 November.The bases page (date joined), review (merges, agent decisions, precedents, decision history) and rule history slice the same way.
ui/index.tsxdocumentslocalDatefor moments; EntityHistory already stopped slicing for this reason.Change
localDate; theymdslicing helpers in Tokens.tsx and MyKbs.tsx go.valid_from,valid_to) still slice; they are calendar dates.Verification
accountRecordDates.test.tsrenders the real pages withTZ=Asia/Shanghai; both tests fail on dev:Review and rules get the same swap, on
TIMESTAMPTZfields, without tests of their own: merges, decision history, precedents and rule history render only after a click, which this DOM-less suite cannot make; the agent rows repeat thelocalDatecall pinned above.Linux x86_64 container, node 20.20.2, pnpm 10.2.1, commit 0d6e2a5:
pnpm test40 files, 283 tests passed;pnpm buildpasses.Limits
localDateTimefits them, in a separate change.p.at.