bug(calendar): --sort start places all-day events at midnight UTC instead of the calendar's timezone

Closed
#1,284 1 comment 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #1286 by @goutamadwant — closed without merging
  • #1301 by @steipete — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
go
Domain
cli

Research direction

Start with internal/cmd/calendar_event_days.go#L142-L155 and internal/cmd/calendar_list.go#L470 to trace how event dates are parsed for sorting. Reproduce the Asia/Tokyo example using the command shown in the issue, then check that the all-day event sorts before the 08:00 event on the same calendar day. An open linked pull request indicates work is already underway.

Written by the indexing model from the issue text.

Description

clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2

Summary

For a calendar in a non-UTC timezone, calendar events --sort start orders an all-day event by midnight UTC. In Asia/Tokyo, an all-day event on 2026-11-03 sorts after an 08:00 event on the same day.

Current (v0.47.1)

gog calendar events --cal 1 --from 2026-11-03 --days 1 --sort start   # calendar timeZone Asia/Tokyo
# timed1   2026-11-03T08:00:00+09:00  …  Breakfast
# allday1  2026-11-03                 …  Holiday

All-day start.date values have no timeZone, so parseEventDate parses them in UTC (calendar_event_days.go#L142-L155, via calendar_list.go#L470).

Suggested

Fall back to the event's calendar timezone (already known for display) when parsing an all-day date for sorting.

Environment

gog v0.47.1 (main at 82e7fd6). Reproduced against a local fake of the Calendar API through GOG_GOOGLE_API_BASE_URL.

Dominant language
Go
Stars
8.6k
Forks
727
Avg merge
19h 20m
Merged PRs (30d)
67

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openclaw/gogcli

All issues in openclaw/gogcli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.