Skip to content

fix(viewer-chrome): format comment timestamps with time and year (#1043) - #1069

Merged
bobsingor merged 4 commits into
embedpdf:mainfrom
TbhVishal:fix/comments-panel-timestamp
Nov 11, 2026
Merged

bobsingor merged 4 commits into
embedpdf:mainfrom
TbhVishal:fix/comments-panel-timestamp

Conversation

@TbhVishal

@TbhVishal TbhVishal commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1043

What and why

Comment and reply timestamps previously only displayed the month and day without time or year. Updated dateLabel in CommentsPanel to include time for the current calendar year, show the year for older dates, and display the full timestamp via native hover title.

Tested with:
pnpm --filter @embedpdf/viewer exec vitest run test/chrome/comments-panel.test.ts

Checklist

  • Follows the conventions in docs/conventions/: plugin shape, state and sync, events, naming.
  • Tests are added or updated at the layer that owns the behavior (a pure core, a mirror fold, a controller, an adapter).
  • Comments stand on their own: no references to plans, decisions, reviews, chats or tickets, and no history (pnpm check:comments).
  • One changeset per directly affected package (pnpm changeset).
  • A public API change regenerates the snapshot (pnpm api:snapshot).

@vercel

vercel Bot commented Nov 10, 2026

Copy link
Copy Markdown

@TbhVishal is attempting to deploy a commit to the CloudPDF Team on Vercel.

A member of the Team first needs to authorize it.

A comment's time is one component for the card and the reply: a `<time>`
with the viewer's own tooltip holding the whole date and time. Its
formatters are built once per language instead of on every row.

Dates, times and file sizes are written in the language the viewer shows,
in the region of its reader: the first of the `locale` option and the
browser's languages that names a region and that the shown language
answers. A language whose code the browser can't read is written in the
browser's own formats, where it used to throw.

In a narrow card the status moves under the time, and a reply's long
author is cut short so its time stays whole.
# Conflicts:
#	api/embedpdf__viewer-chrome/index.api.txt
A time too long for its card reads as two whole lines, `Sep 14, 2025,`
and `10:30 PM`: every space but the one between the day and the time is
a no-break space, so `PM` or a year never ends up alone on a line.
@bobsingor
bobsingor merged commit 3048846 into embedpdf:main Nov 11, 2026
22 of 28 checks passed
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.

Comment timestamps show only day and month, never the time or year

2 participants