Repository navigation
fix(DateDetails): truncate the Unix timestamp instead of rounding it - #1340
Merged
hoorayimhelping merged 1 commit intoDec 3, 2026
Merged
Conversation
The Unix row used Math.round(ms / 1000), so any date with 500 ms or more showed the next second. Unix time truncates; use dayjs().unix(), which floors.
🦋 Changeset detectedLatest commit: 9b4bfa4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Contributor
Chromatic Storybook
Built from commit: Statuses as of the end of the run. The build link shows the live review state. |
XOP
requested review from
hoorayimhelping and
mdevils
and
a balanced review from Copilot
December 1, 2026 13:50
mdevils
approved these changes
Dec 1, 2026
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The Unix timestamp display change has no active review issues.
No open issues 🎉
What changed in this PR
Fixes the Unix timestamp displayed by DateDetails so fractional seconds are floored rather than rounded to the nearest second.
Changes:
- Uses
dayjsDate.unix()to calculate whole Unix seconds. - Adds a regression test for an input with 750 milliseconds.
- Documents the fix in a patch changeset.
| File | Description |
|---|---|
src/components/DateDetails/DateDetails.tsx |
Replaces timestamp rounding with Day.js Unix conversion. |
src/components/DateDetails/DateDetails.test.tsx |
Verifies that a sub-second timestamp does not round up. |
.changeset/fix-date-details-unix-seconds.md |
Adds a patch release note for the corrected display. |
Review effort: Balanced
hoorayimhelping
approved these changes
Dec 3, 2026
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.
Description
DateDetailsusedMath.round(ms / 1000), so any date with 500 ms or more showed the next second (e.g.11:40:00.750displayed1735058401instead of1735058400). Unix time truncates, so this now usesdayjs().unix(), which floors.Links and tickets
None.
Good to know
Only affects dates with a millisecond part of 500 or more; whole-second dates render the same as before.
Checklist
Contribution
buildandbuild-storybookwork locallyAccessibility
No markup, behavior or style changes.
Note
Low Risk
Small display fix in a UI component with a targeted unit test; no auth, data, or API impact.
Overview
Fixes incorrect Unix values in the
DateDetailspopover by switching fromMath.round(ms / 1000)todayjsDate.unix(), so sub-second times floor to whole seconds instead of rounding up at 500 ms (e.g.11:40:00.750now shows1735058400).Adds a regression test for a date with 750 ms and documents the patch in the changeset. Whole-second inputs behave the same as before.
Reviewed by Cursor Bugbot for commit 9b4bfa4. Bugbot is set up for automated code reviews on this repo. Configure here.