Repository navigation
fix(viewer-chrome): format comment timestamps with time and year (#1043) - #1069
Merged
Merged
Conversation
|
@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.
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.
Fixes #1043
What and why
Comment and reply timestamps previously only displayed the month and day without time or year. Updated
dateLabelinCommentsPanelto include time for the current calendar year, show the year for older dates, and display the full timestamp via native hovertitle.Tested with:
pnpm --filter @embedpdf/viewer exec vitest run test/chrome/comments-panel.test.tsChecklist
docs/conventions/: plugin shape, state and sync, events, naming.pnpm check:comments).pnpm changeset).pnpm api:snapshot).