Skip to content

WIP: Add recurring reminders and editable end dates - #110

Draft
morozovpersonal wants to merge 3 commits into
keith:mainfrom
morozovpersonal:feature/recurrence-end-support
Draft

morozovpersonal wants to merge 3 commits into
keith:mainfrom
morozovpersonal:feature/recurrence-end-support

Conversation

@morozovpersonal

Copy link
Copy Markdown

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 with main after #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-until on add
  • repeat changes on edit, including end-only --repeat-until, --clear-repeat-end, and --clear-repeat
  • recurrence details in JSON and plain output, including existing count-based end conditions
  • date-only end values that include the complete requested local day
  • validation that recurring reminders have a due date and do not end before their first due date

Edit safety

  • unrelated title and notes edits leave recurrence untouched
  • end-only edits copy the complete EventKit rule before changing recurrenceEnd, preserving provider-specific calendar metadata and complex selectors
  • interval-only edits preserve all public selectors
  • changing frequency preserves the old end condition but resets interval to 1 unless an explicit interval is supplied
  • multiple existing rules are preserved during end-only and interval-only edits

Verification

  • swift build -Xswiftc -warnings-as-errors
  • 27/27 RecurrenceTests pass
  • read-only EventKit smoke test: 18/18 existing recurring reminders exposed recurrenceEnd; no reminder data was changed

On the local macOS 26 SDK, the full 37-test suite has three pre-existing NaturalLanguageTests expectation failures because Foundation now includes dayOfYear in parsed DateComponents. All recurrence tests pass, and the recurrence changes do not touch that parser behavior.

rameshbaskaran and others added 3 commits August 24, 2026 18:36
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 morozovpersonal changed the title Add recurring reminders and editable end dates WIP: Add recurring reminders and editable end dates Aug 24, 2026
@morozovpersonal
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: support recurrence rules (--repeat hourly/daily/weekly/monthly) Reminder repeat data

2 participants