Skip to content

fix(viewer): use per-value timezone offset when inferring time formats - #267

Merged
donghaoren merged 1 commit into
apple:mainfrom
kwy404:fix-time-formatter-dst
Oct 1, 2026
Merged

donghaoren merged 1 commit into
apple:mainfrom
kwy404:fix-time-formatter-dst

Conversation

@kwy404

@kwy404 kwy404 commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

inferTimeFormatter applied the current UTC offset to every value when hasTimezone is set, so dates on the other side of a daylight saving change were read as 23:00 or 01:00 and the inferred format fell back to showing hours (for example "Jan 1 00:00" instead of "Jan 2024"). This computes the offset for each value instead.

Added a unit test that pins TZ to America/New_York and checks that local midnights in January and July format as "Jan 2024" and "Jul 2024"; it fails before the change and passes after.

inferTimeFormatter applied the current UTC offset to every value, so with hasTimezone set, local midnights on the other side of a daylight saving change were read as 23:00 or 01:00 and the inferred format fell back to showing hours. Compute the offset for each value instead.
@kwy404
kwy404 force-pushed the fix-time-formatter-dst branch from 4a3f5bb to 8301246 Compare September 25, 2026 01:33
@donghaoren
donghaoren merged commit 4e3a6bc into apple:main Oct 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants