Skip to content

bug(calendar): freebusy rejects relative dates that events accepts #806

Description

@privatenumber

Summary

gog calendar events --from/--to accept relative date expressions (today, tomorrow,
monday, now, plain dates), but gog calendar freebusy --from/--to are forwarded raw to the
API and require RFC3339, so the same expressions fail. Inconsistent and surprising.

Repro

gog calendar events   --from today --to tomorrow   # works
gog calendar freebusy --from today --to tomorrow   # fails (API rejects "today")

Root cause (v0.22.0, 197992a)

  • events resolves --from/--to via the shared parser timeparse.ParseRangeExpr
    (internal/cmd/time_helpers.go:257); flags documented as "RFC3339 with timezone, date, or
    relative: now, today, tomorrow, monday" (docs/commands/gog-calendar-events.md:37,54).
  • freebusy passes raw strings straight through: TimeMin: c.From / TimeMax: c.To
    (internal/cmd/calendar_freebusy.go:38-39); help says "RFC3339, required" (:19-20).

Suggested fix

Route freebusy --from/--to through the same ParseRangeExpr helper as events (resolving in
the calendar's timezone), and update the flag help. Recommend auditing other date-taking calendar
commands (e.g. conflicts) for the same gap.

Environment

gog v0.22.0 (confirmed by reading source at 197992a).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExempts this issue from stale automation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions