One timestamp formatter: audit and unify date/time display across timeline, room list, search, threads #139

Closed
opened 2026-09-17 16:26:17 -04:00 by jared · 1 comment
Owner

Audit every place a time is rendered (timeline hover/inline, day dividers, room-list last message, search results, thread panel, pinned menu, edit history, scheduled tray, reminders, jump-to-time) and the format each uses; then route all of them through one helper honouring dateFormatString and the 12/24 h preference, with consistent rules: today → time; yesterday → "Yesterday 21:14"; this week → weekday + time; older → date. Pure function, unit-tested; no visual change beyond consistency.

Audit every place a time is rendered (timeline hover/inline, day dividers, room-list last message, search results, thread panel, pinned menu, edit history, scheduled tray, reminders, jump-to-time) and the format each uses; then route all of them through one helper honouring `dateFormatString` and the 12/24 h preference, with consistent rules: today → time; yesterday → "Yesterday 21:14"; this week → weekday + time; older → date. Pure function, unit-tested; no visual change beyond consistency.
jared added this to the Features 2026-Q4 milestone 2026-09-17 16:26:17 -04:00
jared added the priority: lowuxtech-debtarea: messaging labels 2026-09-17 16:26:17 -04:00
jared self-assigned this 2026-09-17 16:26:17 -04:00
Author
Owner

Done in 4d4a7621.

Audit → what each place used → now

surface before now
timeline hover/inline (Time) time / Yesterday time / date time format(ts) — same, plus weekday for the last 6 days
day dividers (room + thread) Today / Yesterday / D MMMM YYYY formatDayDivider — Today / Yesterday / Monday / user date format
forwarded header, thread summary chip, device "Last activity", kick/ban alerts, edit history four hand-rolled copies of the same branch (edit history said date at time) format(ts)
read receipts Today at… / Mon 5 at… (hard-coded month/day order) format(ts)
room list DM time 5m / 3h / Yesterday / D MMM (ignored date pref) formatShortAge — same shape, date per pref with the year dropped when current
bookmarks, threads list, media gallery tiles, activity log (en-US forced!) three relative-age variants ending in a locale-default date formatRelativeAgejust now / 5m ago / 3h ago / yesterday / 3d ago / user date
scheduled tray, schedule preview, reminders, notification snooze toLocaleTimeString (ignored 12/24 h) formatFriendlyDateTimeToday at 15:30 / Tomorrow at 09:00 / Mon at 09:00 / 12 Jan 2026 at 09:00
search cache "oldest", room insights range + "last updated", lightbox date toLocale*String format(ts,'date') / 'time'
jump-to-time chips, message aria-label, "Created by … on" D MMMM YYYY fixed user date format

Left alone on purpose: the media gallery's month section headers ("September 2026") and the calendar widget's month labels — they're not timestamps.

utils/formatTimestamp.ts is pure (injected now), 11 unit tests; useTimestampFormatter() binds it to hour24Clock + dateFormatString. 12-hour times stay zero-padded (09:14 PM) exactly as before, so the timeline looks the same today.

Done in 4d4a7621. ### Audit → what each place used → now | surface | before | now | |---|---|---| | timeline hover/inline (`Time`) | time / `Yesterday time` / `date time` | `format(ts)` — same, plus weekday for the last 6 days | | day dividers (room + thread) | Today / Yesterday / `D MMMM YYYY` | `formatDayDivider` — Today / Yesterday / **Monday** / user date format | | forwarded header, thread summary chip, device "Last activity", kick/ban alerts, edit history | four hand-rolled copies of the same branch (edit history said `date at time`) | `format(ts)` | | read receipts | `Today at…` / `Mon 5 at…` (hard-coded month/day order) | `format(ts)` | | room list DM time | `5m` / `3h` / `Yesterday` / `D MMM` (ignored date pref) | `formatShortAge` — same shape, date per pref with the year dropped when current | | bookmarks, threads list, media gallery tiles, activity log (`en-US` forced!) | three relative-age variants ending in a locale-default date | `formatRelativeAge` — `just now` / `5m ago` / `3h ago` / `yesterday` / `3d ago` / user date | | scheduled tray, schedule preview, reminders, notification snooze | `toLocaleTimeString` (ignored 12/24 h) | `formatFriendlyDateTime` → `Today at 15:30` / `Tomorrow at 09:00` / `Mon at 09:00` / `12 Jan 2026 at 09:00` | | search cache "oldest", room insights range + "last updated", lightbox date | `toLocale*String` | `format(ts,'date')` / `'time'` | | jump-to-time chips, message aria-label, "Created by … on" | `D MMMM YYYY` fixed | user date format | Left alone on purpose: the media gallery's month section headers ("September 2026") and the calendar widget's month labels — they're not timestamps. `utils/formatTimestamp.ts` is pure (injected `now`), 11 unit tests; `useTimestampFormatter()` binds it to `hour24Clock` + `dateFormatString`. 12-hour times stay zero-padded (`09:14 PM`) exactly as before, so the timeline looks the same today.
jared closed this issue 2026-09-20 00:29:19 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#139