Skip to content

fix: compare all-day events in their calendar's time zone - #96

Open
nvtoan0201-swe wants to merge 1 commit into
CopilotKit:mainfrom
nvtoan0201-swe:fix/all-day-event-timezone
Open

nvtoan0201-swe wants to merge 1 commit into
CopilotKit:mainfrom
nvtoan0201-swe:fix/all-day-event-timezone

Conversation

@nvtoan0201-swe

Copy link
Copy Markdown

What changed

All-day events are date-only values, but the mobile event editor compared them with raw Date.parse, which treats "2026-09-30" as UTC midnight:

  • EventEditor conflict detection could miss a timed event later the same local day or flag an event on the previous day (apps/mobile/src/details.tsx).
  • The overlap card printed clock times ("5:00 PM–5:00 PM") for all-day conflicts.
  • The Calendar "Next 30 days" header showed all-day events one day early in zones west of UTC (apps/mobile/src/screens.tsx).

This adds calendarInterval / calendarOverlap to the existing pure time helpers (apps/mobile/src/date-time.ts), which resolve date-only values through zonedInstant in the event's own zone. Both are covered in apps/mobile/test/date-time.test.ts (LA evening overlap, previous-day non-overlap, Tokyo date boundary, boundary touch, invalid zones/dates).

Verification

  • pnpm test — 281 pass, 0 fail (5 new tests)
  • pnpm lint
  • pnpm typecheck (root + mobile)

No simulator/device run; only pure interval logic and labels changed.

Integration limits

Existing stored events already carry allDay and timeZone, so no data migration is needed.

AI assistance was used to prepare this change; I reviewed the code, tests and checks above.

EventEditor parsed date-only starts and ends as UTC midnight, so an all-day event could miss a timed event later that local day or flag an event on the previous day. The conflict row also printed clock times for all-day events, and the Next 30 days header showed all-day events one day early west of UTC. Add calendarInterval/calendarOverlap helpers that resolve date-only values through zonedInstant, use them for conflict detection, and label all-day conflicts and headers from their date.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant