Skip to content

fix(calendar): add timezone to EventDateTime for recurring events#53

Merged
steipete merged 2 commits intoopenclaw:mainfrom
visionik:fix/recurring-event-timezone
Jan 9, 2026
Merged

fix(calendar): add timezone to EventDateTime for recurring events#53
steipete merged 2 commits intoopenclaw:mainfrom
visionik:fix/recurring-event-timezone

Conversation

@visionik
Copy link
Copy Markdown
Collaborator

@visionik visionik commented Jan 9, 2026

Problem

When creating a recurring event via gog calendar create with --rrule, the Google Calendar API returns:

Google API error (400 required): Missing time zone definition for start time.

This happens because Google requires an explicit TimeZone field on the EventDateTime struct for recurring events.

Solution

Extract the timezone from the RFC3339 offset in the --from/--to values and map common offsets to IANA timezone names.

Example

This now works:

gog calendar create primary \
  --summary 'Publix Pharmacy App Order' \
  --from '2026-01-08T11:00:00-05:00' \
  --to '2026-01-08T11:30:00-05:00' \
  --rrule 'RRULE:FREQ=DAILY;INTERVAL=28' \
  --account user@example.com

Notes

  • Maps common US timezone offsets (-8 to -4) to IANA names
  • UTC (Z suffix or +00:00) is handled
  • Unknown offsets gracefully degrade (no timezone set, non-recurring events still work)
  • Added unit tests for extractTimezone()

visionik and others added 2 commits January 9, 2026 05:53
Google Calendar API requires an explicit TimeZone field on EventDateTime
when creating recurring events. Without it, the API returns:
'Missing time zone definition for start time.'

This change extracts the timezone from the RFC3339 offset in the --from/--to
values and maps common US offsets to IANA timezone names.

Fixes recurring event creation via:
  gog calendar create primary --summary 'Test' \
    --from '2026-01-08T11:00:00-05:00' \
    --to '2026-01-08T11:30:00-05:00' \
    --rrule 'RRULE:FREQ=DAILY;INTERVAL=28'
@steipete steipete force-pushed the fix/recurring-event-timezone branch from 6a9759e to 00dcff3 Compare January 9, 2026 04:58
@steipete steipete merged commit 6c6a354 into openclaw:main Jan 9, 2026
4 checks passed
@steipete
Copy link
Copy Markdown
Collaborator

steipete commented Jan 9, 2026

Landed with small follow-ups:

  • Rebased onto main @8fe47fc
  • Improved timeZone inference by matching candidate IANA zones at the event instant (DST-safe; adds America/Phoenix)
  • Updated unit tests + CHANGELOG
  • Local gate: make lint/build/test (repo has no package.json, so pnpm scripts not available)

Commits:

Thanks @visionik!

manascb1344 pushed a commit to manascb1344/gogcli that referenced this pull request Jan 15, 2026
manascb1344 pushed a commit to manascb1344/gogcli that referenced this pull request Jan 15, 2026
…zone

fix(calendar): add timezone to EventDateTime for recurring events
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.

2 participants