Skip to content

Fix Past() to properly calculate for all-day events - #2173

Open
chrisdebian wants to merge 1 commit into
wtfutil:trunkfrom
chrisdebian:fix/gcal-allday-past-detection
Open

Fix Past() to properly calculate for all-day events#2173
chrisdebian wants to merge 1 commit into
wtfutil:trunkfrom
chrisdebian:fix/gcal-allday-past-detection

Conversation

@chrisdebian

Copy link
Copy Markdown

`Past()` unconditionally returned `false` for all-day events (per the existing `FIXME` comment), so an all-day event that had already happened was never reported as past.

Google Calendar's all-day event end dates are exclusive (a single-day event starting on the 3rd has an end date of the 4th), so an event is past once its end date's midnight is today or earlier. This adds that date-only comparison for the all-day case, plus tests covering single-day and multi-day events before, during, and after "today".

Verified with `go build`, `go vet`, `gofmt`, and `go test` on `modules/gcal`.

Past() unconditionally returned false for all-day events (see the
FIXME), so an all-day event that had already happened was never
reported as past. Google Calendar's all-day event end dates are
exclusive, so an event is past once its end date's midnight is today
or earlier. Adds a date-only comparison for the all-day case and
tests covering single-day and multi-day events before, during, and
after "today".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant