cli icon indicating copy to clipboard operation
cli copied to clipboard

[Bug] All-day events show incorrect start date in calendar +agenda

Open rebugui opened this issue 8 months ago • 1 comments

Description

When displaying all-day events via gws calendar +agenda, the start date appears to be earlier than the actual event date.

Steps to Reproduce

  1. Create an all-day event (e.g., March 23, 2026)
  2. Run: gws calendar +agenda --days 7 --format table
  3. Observe the start date in output

Expected Behavior

All-day event on March 23 should show:

  • start: 2026-03-23
  • end: 2026-03-24 (or 2026-03-23)

Actual Behavior

All-day event on March 23 shows:

  • start: 2026-03-21
  • end: 2026-03-23

Example output:

calendar  end                        start                      summary
────────  ─────────────────────────  ─────────────────────────  ────────────────────────
일정        2026-03-23                2026-03-21                 
일정        2026-03-23                2026-03-21                 
일정        2026-03-27                2026-03-23                 

Environment

  • gws version: 0.18.1
  • OS: macOS 15.2 (arm64)
  • Install method: Homebrew
  • Timezone: Asia/Seoul (GMT+9)

Additional Context

This issue affects all all-day events. The start date consistently shows 2 days earlier than the actual event date.

Timed events (with specific start/end times like 2026-03-23T18:45:00+09:00) display correctly.

The issue appears to be related to timezone handling for all-day events which use date field instead of dateTime in Google Calendar API response.

rebugui avatar Mar 22 '26 06:03 rebugui

Hi, I'd like to work on this! I've identified the root cause; the events.list API call in +agenda doesn't pass a timeZone parameter, so the API interprets all-day event boundaries in the wrong timezone. I'm working on a fix that passes the resolved account timezone to the API and properly handles the date vs dateTime field distinction for all-day events.

jorj-pineda avatar Apr 01 '26 05:04 jorj-pineda