Skip to content

feat(RelativeTime): expose the compact absolute-time preset - #8804

Draft
tay1orjones wants to merge 3 commits into
mainfrom
copilot/expose-compact-absolute-time-preset
Draft

tay1orjones wants to merge 3 commits into
mainfrom
copilot/expose-compact-absolute-time-preset

Conversation

@tay1orjones

@tay1orjones tay1orjones commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RelativeTime can now shorten absolute timestamps without changing when they appear. The element still owns formatting and preserves the full timestamp title.

<RelativeTime date={timestamp} format="datetime" absoluteFormat="compact" />

Changelog

New

  • absoluteFormat="compact" shows localized today with 12-hour time or a date with its year. It omits the visible time zone and overrides prefix, formatStyle, and individual display fields.
  • Public prop documentation and a Storybook comparison with standard absolute output.

Changed

  • Removing absoluteFormat restores standard output without remounting the element.

Removed

Rollout strategy

  • No changes needed in github/github-ui

Keep in draft. Upstream issue #404 · Implementation PR #405. Tested the package built from 84ab6dc47882f5e487a46059a13b340076c33e06. The rechecked head, adfbb14, changes only initial rollover scheduling and its tests.

The latest verified release, 5.3.1, does not expose the prop. The committed dependency is unchanged, so type checking and the compact browser cases remain blocked. Before merge, require a published version with the runtime property and declarations, regenerate the root lockfile, and rerun CI.

Testing & Reviewing

  • In RelativeTime → Features → Compact Absolute Format, compare compact today and another day with standard absolute output.
  • Check that adding and removing the prop updates the live text without changing datetime, titles, noTitle, or the UTC hydration fallback. With the absolute preference off, relative output stays relative.

@changeset-bot

changeset-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 29aa400

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copilot AI linked an issue Nov 19, 2026 that may be closed by this pull request
9 tasks
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@tay1orjones tay1orjones changed the title [WIP] Expose the compact absolute-time preset in RelativeTime feat(RelativeTime): expose the compact absolute-time preset Nov 19, 2026
@tay1orjones

Copy link
Copy Markdown
Contributor Author

@copilot @github/relative-time-element 5.4.0 is out with absoluteFormat. Update this PR to use it.

  1. Set @github/relative-time-element to ^5.4.0 in packages/react/package.json.
  2. Update the root package-lock.json so it resolves 5.4.0. Match the existing lockfile format. Don't change any other dependency.
  3. Run the type check and the RelativeTime tests.
  4. In the PR description, replace the "Keep in draft" paragraph with one sentence: this needs @github/relative-time-element 5.4.0 or later. Leave the rest of the description alone.

5.4.0 also ships other fixes: calendar-day "yesterday" and "tomorrow", tabular numerals, and relative text for past times under a minute. If a RelativeTime test fails because of one of them, don't change the test. Comment with the test name and the error, then stop.

Keep the PR in draft. Don't touch github-ui.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

@copilot @github/relative-time-element 5.4.0 is out with absoluteFormat. Update this PR to use it.

  1. Set `@github/relative-t...

Updated in 29aa400. The workspace requires ^5.4.0, and the lockfile resolves exactly 5.4.0. Type checking and all 17 RelativeTime tests passed without test changes. The PR remains in draft.

The local install used --min-release-age=0; the unchanged seven-day rule still blocks a default install. I couldn’t edit the PR description from this session. The replacement sentence is: Compact absolute-time formatting requires @github/relative-time-element 5.4.0 or later.

@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions
github-actions Bot requested a deployment to storybook-preview-8804 November 20, 2026 20:46 Abandoned

This branch had an error being deployed

1 failed and 1 abandoned deployments
storybook-preview-8804 — 29aa400b Deployed Nov 20, 2026 by github-actions[bot]
github-pages — 29aa400b Deployed Nov 20, 2026 by tay1orjones via deploy-preview #34484
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose the compact absolute-time preset in RelativeTime

2 participants