Skip to content

Feat/timestamp component#97

Merged
Shrinks99 merged 9 commits into
mainfrom
feat/timestamp-component
Jun 9, 2026
Merged

Feat/timestamp component#97
Shrinks99 merged 9 commits into
mainfrom
feat/timestamp-component

Conversation

@giuliana-gladeye

Copy link
Copy Markdown
Collaborator

@Shrinks99 Added FormatDate component for rendering timestamps as either relative ("2 weeks ago") or absolute ("Jun 9 2026, 18:42:03 UTC") time.

  • Accepts an ISO 8601 string, epoch milliseconds, or a Date
  • displayAs="relative" | "absolute" (defaults to absolute)
  • Built on native Intl.RelativeTimeFormat / Intl.DateTimeFormat, no date library dependency
  • Relative mode shows the absolute time in a tooltip on hover/focus (tooltip, default on) and re-renders on an interval to stay current (live, default on)
  • Configurable timeZone (default UTC), locale (default en-US), and absoluteOptions for full control of absolute formatting
  • Renders a semantic <time dateTime={...}> element and forwards extra props/className
  • If date is wrong fallbacks to "Invalid date"
screencapture-localhost-4321-components-format-date-2026-06-10-09_42_51

This work is part of linear ticker "Update date and time displays across various pages"

@Shrinks99 Shrinks99 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved barring notes from slack and this one comment where I think we can shorten some docs text :)

Comment thread packages/demo/src/content/components/format-date.mdx Outdated
@Shrinks99 Shrinks99 merged commit 92ca1c0 into main Jun 9, 2026
1 check passed
@Shrinks99 Shrinks99 deleted the feat/timestamp-component branch June 9, 2026 22:51
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.

2 participants