Repository navigation
feat(ui): release 5.4.1 with a time zone for DateRangePicker - #224
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its zone paths Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nge from its days Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ight Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Need
Guardian shows dates in each user's own time zone, a Settings preference. Its Credentials and agent Memberships tables filter by date with
DateRangePicker, which can only cut days in the browser's zone. Near midnight, the range a user picks lands a day apart from the dates in the rows it filters. For now Guardian works around this by showing the filter chip in the browser's zone too.Problem
DateRangePickerbuilds every day on the browser's clock:new Date(y, m, d)for the cells,setHours(0…)andsetHours(23, 59…)for the range it hands back, and the browser's today. It takes no zone.Change
timeZone, an IANA name. Without it, days follow the browser's zone as before.fromandtohanded back all follow the zone.fromis the day's first instant there.tois a millisecond before the next day's first instant. On a day whose midnight a clock change skips, such as Havana's on 8 March, the day starts at its first time.lib/zoned-day.ts. It usesIntlonly, with no new dependency, and finds a day's first instant by binary search over the window every zone sits in.dateRange.from!.fromortocounts as unset rather than throwing fromIntl(5.4.0 labelled it "Invalid Date").aria-current="date".@defaultfortimeZone.timeZonerow in the props table. Minor in effect, released as 5.4.1.Evidence
zoned-day: the day an instant falls on, midnight in Auckland and Kathmandu (+5:45), Havana's skipped midnight, and the end of a day.2026-03-09T11:00Zto2026-03-12T10:59:59.999Z, and the label reads those days. Picking the earlier day second swaps the ends, and today is the 16th while UTC is still on the 15th.RangeError.addDaysrolls across a month and a year.main's picker. All the new tests pass with the test runner in UTC, New York, Kolkata and Auckland.timeZone.Not covered
Intl, asFormatDatedoes, rather than falling back silently and hiding a typo. Documented and tested; Guardian passes a validated preference.timeZonechanged afterwards doesn't move it. Guardian's zone is set before mount, and Settings, where it changes, remounts the picker.timeZone, the browser's zone is read once per session, so it won't follow a mid-session change of the OS zone. Guardian always passes a zone.FormatDate's time zones section does.🤖 Generated with Claude Code