DateTime: middle tier shows relative time only — move the "ordinal of Month" into the hover tooltip #312
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#312
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's requested
The date component's middle tier currently renders
"3 days ago - 2nd of September"— the visible text should become just the relative portion ("3 days ago"), with the"{ordinal} of {Month}"part moved into the hover tooltip (prepended to the existing local-time tooltip).Current implementation (code evidence)
fmtDate(web/src/lib/format.js:193-206): the 1–30-day tier returns`${plural(days, "day")} - ${monthDay}`wheremonthDay = "{ordinal} of {Month}".<DateTime>(web/src/components/DateTime.jsx) rendersfmtDateas visible text andfmtDateTitle(local wall time "YYYY-MM-DD HH:MM CDT") as thetitle— the title currently has no calendar date, which is why the ordinal/month lives in the visible text today.format.js:131-158document the tier contract and law-12 decisions; the visible-text change and the tooltip change are bothformat.js-internal (one new helper, one amended tier, one amended title) —DateTime.jsxneeds no change.Proposed change
fmtDatemiddle tier → return onlyplural(days, "day")(e.g."3 days ago"). ThemonthDaystring moves out of the visible text.fmtDateTitle→ prepend the calendar date to the existing local-time tooltip for timestamps in the 1–30-day window:"{Month} {ordinal} · YYYY-MM-DD HH:MM <zone>"(e.g."September 2nd · 2025-09-02 14:03 CDT"). Exact separator is the implementer's call — keep it terse and consistent. The 31+-day tier keeps its existing title (its visible text already carries the full date).format.jsis headless-tested (there are existingfmtDate/fmtDateTitleunit tests per the repo's headless-module rule) — update the middle-tier expectations and add title assertions for both tiers' boundary cases (exactly 1 day, 30 days, 31 days).Acceptance criteria
node --test web/test/unit/*.test.js).Fix ready for review: PR #316 (#316, branch fix/issue-312). Middle tier renders relative-only; tooltip prepends "{Month} {ordinal} · wall time" in the 1–30d window; 31+ day tier untouched. Web unit suite 596/596 green.
Review of PR #316 (fix/issue-312, commit
f6de1e3) — verified in scratch worktree /tmp/pr316 (removed afterward); main worktree untouched (still clean on main).FINDINGS (all checked, no defects):
TESTS (scratch worktree, node_modules symlinked from main checkout since worktrees don't carry ignored dirs):
No fixes pushed (nothing to fix).
MERGE RECOMMENDATION: ready to merge.
Fixed by PR #316 (review clean; tier + tooltip boundaries verified; all green), merged. Closing.