aboutsummaryrefslogtreecommitdiff
path: root/tests/testutil-calendar-sync.el
Commit message (Collapse)AuthorAgeFilesLines
* fix(test): anchor monthly tests on a day every month hasCraig Jennings15 hours1-0/+16
| | | | | | | | | | | | | | | | | | - The tests anchored on tomorrow, whose day varies by run date. - A series on the 31st correctly skips months without one. - That gave seven occurrences against an assertion of ten. - The suite went red on the 30th and aborted the run. A relative offset is not a date-independent anchor, which is what the file header claimed it was. I added a helper that walks forward to the first day at or below the 28th, and pointed the three cadence tests at it. One assertion was also too weak to notice. It checked that each occurrence fell on or before the anchor day, which a skipped month satisfies without ever landing on the right day. It now checks equality. Verified across 400 simulated run dates: no anchor past the 28th and no count outside the expected band. The old anchor fails nine of those days.
* feat(calendar-sync): add timezone conversion for TZID-qualified eventsCraig Jennings2026-02-011-0/+83
| | | | | | | | | | | | Events with TZID parameters (e.g., DTSTART;TZID=Europe/Lisbon) were displaying in the source timezone instead of local time. Added: - calendar-sync--extract-tzid: extracts TZID from property lines - calendar-sync--convert-tz-to-local: converts using date command - Modified parse-timestamp to accept optional TZID parameter - Modified parse-event to extract and pass TZID through pipeline Includes 40 new tests covering extraction, conversion, and integration.
* feat(calendar-sync): multi-calendar support with property testsCraig Jennings2025-12-021-1/+89
| | | | | | Added multi-URL calendar sync supporting Google and Proton calendars. Each calendar syncs to separate file with per-calendar state tracking. Added 13 property-based tests for RRULE expansion. Total: 150 tests passing.
* feat(calendar-sync): Add automatic timezone detection and chronological sortingCraig Jennings2025-11-161-0/+110
Implemented calendar-sync.el as a complete replacement for org-gcal, featuring: **Core Functionality:** - One-way sync from Google Calendar to Org (via .ics URL) - UTC to local timezone conversion for all event timestamps - Chronological event sorting (past → present → future) - Non-blocking sync using curl (works reliably in daemon mode) **Automatic Timezone Detection:** - Detects timezone changes when traveling between timezones - Tracks timezone offset in seconds (-21600 for CST, -28800 for PST, etc.) - Triggers automatic re-sync when timezone changes detected - Shows informative messages: "Timezone change detected (UTC-6 → UTC-8)" **State Persistence:** - Saves sync state to ~/.emacs.d/data/calendar-sync-state.el - Persists timezone and last sync time across Emacs sessions - Enables detection even after closing Emacs before traveling **User Features:** - Interactive commands: calendar-sync-now, calendar-sync-start/stop - Keybindings: C-; g s (sync), C-; g a (start auto-sync), C-; g x (stop) - Optional auto-sync every 15 minutes (disabled by default) - Clear status messages for all operations **Code Quality:** - Comprehensive test coverage: 51 ERT tests (100% passing) - Refactored UTC conversion into separate function - Clean separation of concerns (parsing, conversion, formatting, sorting) - Well-documented with timezone behavior guide and changelog **Migration:** - Removed org-gcal-config.el (archived in modules/archived/) - Updated init.el to use calendar-sync - Moved gcal.org to .emacs.d/data/ for machine-independent syncing - Removed org-gcal appointment capture template Files modified: modules/calendar-sync.el:442, tests/test-calendar-sync.el:577 Files created: data/calendar-sync-state.el, tests/testutil-calendar-sync.el Documentation: docs/calendar-sync-timezones.md, docs/calendar-sync-changelog.md