Repository navigation
fix: keep the calendar day view working when midnight is skipped by DST - #150
Merged
jerelvelarde merged 3 commits intoOct 6, 2026
Merged
Conversation
The events query built its day range with zonedInstant(date, '00:00'), which deliberately throws for nonexistent local times. On days when a zone springs forward at midnight (e.g. America/Santiago 00:00→01:00), the whole day view failed with 'This time does not exist' and showed no events. Day boundaries are a range-computation detail, not an entered appointment time, so startOfZonedDay clamps to the first existing local time instead of throwing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jerelvelarde
previously approved these changes
Oct 6, 2026
jerelvelarde
left a comment
Collaborator
There was a problem hiding this comment.
Value: day-range queries work when DST skips midnight, while appointment entry still rejects nonexistent times. Six date-time tests passed. Template: verification and rendered-screen limitation stated; UI evidence would complete the description. Updated-main diff reviewed; no actionable security finding. Merge after required CI.
jerelvelarde
approved these changes
Oct 6, 2026
jerelvelarde
left a comment
Collaborator
There was a problem hiding this comment.
Re-reviewed the formatting-only revision. Six date-time tests and Biome on all changed files pass. Previous value/template/security assessment holds. Merge after all required CI checks pass.
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.
Problem
The calendar events query built its day range with
zonedInstant(date, "00:00", zone), which deliberately throws for nonexistent local times. On days when a zone springs forward at midnight (e.g. America/Santiago goes 00:00→01:00 on 2026-09-06), the promise rejected, the effect showed the "This time does not exist" error, and the user saw zero events for that day (in 30-day mode the whole query failed).A day boundary is a range-computation detail, not a user-entered appointment time, so rejecting it serves no purpose.
Fix
Add
startOfZonedDayindate-time.ts: resolve 00:00, and when a DST gap removes midnight, clamp to the first existing local time that day. The calendar query uses it for both range ends; event creation still useszonedInstantand keeps rejecting gap times.Verification
apps/mobile/test/date-time.test.ts: the Santiago spring-forward day clamps to 01:00 local (04:00Z), ordinary days still start at midnight.pnpm --dir apps/mobile typecheckpasses and the mobile unit tests pass.startOfZonedDaylevel instead.Co-authored-by: Claude noreply@anthropic.com