WIP: Add recurring reminders and editable end dates - #110
Draft
morozovpersonal wants to merge 3 commits into
Draft
morozovpersonal wants to merge 3 commits into
morozovpersonal wants to merge 3 commits into
Conversation
Implements EKRecurrenceRule-backed recurrence, requested in keith#104: - `reminders add <list> <reminder> --repeat daily|weekly|monthly|yearly` - `--repeat-interval N` to repeat every N units instead of every 1 (default 1), e.g. `--repeat-interval 2 --repeat weekly` for fortnightly. - `--repeat-until <date>` to set a recurrence end date; omitting it repeats forever, matching Reminders.app's own default. - `reminders edit <list> <index> --repeat ...` replaces an existing repeat rule; `--clear-repeat` removes it entirely. - JSON output (`--format json`) now includes `recurrence`, `recurrenceInterval`, and `recurrenceEnd` fields when a reminder has a recurrence rule, so scripts consuming `reminders show --format json` can see it. `hourly` is intentionally rejected with a clear validation error rather than silently degrading to a daily rule: EventKit's `EKRecurrenceFrequency` has no hourly case (Reminders.app's own UI doesn't expose hourly repeat either), so there's no faithful way to represent it via `EKRecurrenceRule`. Tested live against real Reminders.app data (add with daily/weekly/ monthly + custom interval + end date, edit to replace and to clear, hourly correctly rejected, --repeat-interval/--repeat-until correctly rejected without --repeat, conflicting --repeat + --clear-repeat correctly rejected). Added Tests/RemindersTests/RecurrenceTests.swift covering the frequency mapping, interval, end-date, and representability logic at the unit level. Note on test execution: this dev environment currently has only Command Line Tools installed (no full Xcode), so `swift test` can't link XCTest here (`xcrun --find xctest` fails) -- this affects the pre-existing NaturalLanguageTests.swift identically, so it's an environment gap, not something this change introduces. `swift build` succeeds cleanly and all behavior was verified against the live binary instead; the new test file is plain XCTest and should run normally under CI or on a machine with full Xcode.
morozovpersonal
marked this pull request as draft
August 24, 2026 17:25
udondan
pushed a commit
to udondan/reminders-cli
that referenced
this pull request
Sep 13, 2026
Adds `edit --repeat-until <date>` and `--clear-repeat-end` so a reminder's recurrence end condition can be changed on its own, without needing to also respecify the frequency. An end-only edit copies the existing EventKit recurrence rule and only changes its end, preserving interval and any complex selectors instead of rebuilding a plain rule from scratch. Also validates that a repeating reminder always has a due date, and that the recurrence end can't be earlier than it. Ported from keith/reminders-cli#110, authored by Aleksei Morozov.
udondan
pushed a commit
to udondan/reminders-cli
that referenced
this pull request
Sep 13, 2026
The previous end-only edit path rebuilt the recurrence rule via the public EKRecurrenceRule initializer, which drops provider-specific metadata such as calendarIdentifier and firstDayOfTheWeek. Copy the existing rule instead and only mutate its recurrenceEnd, so an end-only edit is fully transparent to everything else about the rule. Ported from keith/reminders-cli#110, authored by Aleksei Morozov.
udondan
referenced
this pull request
in udondan/reminders-cli
Sep 13, 2026
EventKit doesn't advance dueDateComponents on a repeating EKReminder as occurrences pass, so a recurring reminder's due date can end up arbitrarily overdue rather than reflecting the next actionable occurrence (observed directly against Reminders.app; documented in the README since Apple doesn't cover this behavior). hasRecurrence is now always encoded as a boolean so scripts don't have to check for a missing or null field. nextDueDate steps the recurrence rule's frequency/interval forward from its due date, honoring --repeat-until/occurrence-count ends, and is only populated for the plain daily/weekly/monthly/yearly rules this CLI itself creates and edits. Extends the recurrence support ported from keith/reminders-cli#109 and #110. Co-authored-by: Ramesh Baskaran <ramesh.baskaran@gmail.com> Co-authored-by: Aleksei Morozov <246998741+morozovpersonal@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context and attribution
This PR starts from Ramesh Baskaran's recurrence implementation in #109 (commit
8891097d32f1487a7b051a89ffa6b4459d4b9cc7). That commit and its original authorship are preserved as the first commit here. #109 currently conflicts withmainafter #108, so this branch reapplies that work to the current base and extends it with safe end-date editing.Closes #84.
Closes #104.
What it adds
--repeat daily|weekly|monthly|yearly,--repeat-interval, and--repeat-untilonaddedit, including end-only--repeat-until,--clear-repeat-end, and--clear-repeatEdit safety
recurrenceEnd, preserving provider-specific calendar metadata and complex selectorsVerification
swift build -Xswiftc -warnings-as-errorsRecurrenceTestspassrecurrenceEnd; no reminder data was changedOn the local macOS 26 SDK, the full 37-test suite has three pre-existing
NaturalLanguageTestsexpectation failures because Foundation now includesdayOfYearin parsedDateComponents. All recurrence tests pass, and the recurrence changes do not touch that parser behavior.