From a23600a4863487e9b0430d2ad48155efd26650dc Mon Sep 17 00:00:00 2001 From: Keith Smith Date: Mon, 31 Aug 2026 21:21:50 -0600 Subject: [PATCH] Document custom recurrence RRULE patterns and fix stale field names API.md now lists the supported custom RRULE patterns (every Wednesday, every other Wednesday, every second Tuesday, every 15th, etc.) matching the newly implemented dateutil.rrule evaluation. CLAUDE.md's Task model reference also gets corrected: it listed recurrence_type/recurrence_interval fields that never existed on the model. Co-Authored-By: Claude Sonnet 5 --- API.md | 16 ++++++++++++++-- CLAUDE.md | 6 +++--- README.md | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/API.md b/API.md index fba55dd..0547aba 100644 --- a/API.md +++ b/API.md @@ -1050,11 +1050,23 @@ Use `page` query parameter to navigate: `?page=2` - New instance has `status: pending` and calculated `due_date` - Recurrence stops at `recurrence_end_date` if specified -**Custom RRULE Example:** +**Custom RRULE Patterns:** + +`recurrence_rule` accepts a standard RFC5545 RRULE string, evaluated via `dateutil.rrule`. Currently supported: `FREQ=WEEKLY` (with `INTERVAL` and `BYDAY`) and `FREQ=MONTHLY` (with `INTERVAL` and either `BYMONTHDAY` or an ordinal-prefixed `BYDAY`). The web UI's Custom recurrence builder generates these same strings. + +| Pattern | `recurrence_rule` | +|---|---| +| Every Wednesday | `FREQ=WEEKLY;INTERVAL=1;BYDAY=WE` | +| Every other Wednesday | `FREQ=WEEKLY;INTERVAL=2;BYDAY=WE` | +| Every Mon/Wed/Fri | `FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR` | +| Every 15th of the month | `FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15` | +| Every second Tuesday | `FREQ=MONTHLY;INTERVAL=1;BYDAY=2TU` | +| Last Friday of the month | `FREQ=MONTHLY;INTERVAL=1;BYDAY=-1FR` | + ```json { "recurrence": "custom", - "recurrence_rule": "FREQ=WEEKLY;BYDAY=MO,WE,FR", + "recurrence_rule": "FREQ=MONTHLY;INTERVAL=1;BYDAY=2TU", "recurrence_end_date": "2024-12-31" } ``` diff --git a/CLAUDE.md b/CLAUDE.md index 2860536..5f58de6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -97,7 +97,7 @@ celery -A config beat -l info **tasks/** - Core task management - Hierarchical tasks with parent/subtask relationships - Task status (pending, in_progress, completed, cancelled) and priority (low, medium, high, urgent) -- Recurrence patterns (daily, weekly, monthly, yearly, custom RRULE) +- Recurrence patterns (daily, weekly, biweekly, monthly, yearly, or custom RRULE for day-of-week/nth-weekday/day-of-month control) - Time tracking with start/stop timer functionality - Tag system with colors and icons for organization - Task sharing with permission levels (viewer/editor) @@ -234,7 +234,7 @@ Configured in `config/celery.py`: - Hierarchy: `parent` (ForeignKey to self) - Status: pending, in_progress, completed, cancelled - Priority: low, medium, high, urgent -- Recurrence: `recurrence_type`, `recurrence_interval`, `recurrence_rule` (RRULE) +- Recurrence: `recurrence` (none/daily/weekly/biweekly/monthly/yearly/custom), `recurrence_rule` (RRULE string, used when `recurrence='custom'`, parsed via `dateutil.rrule`), `recurrence_end_date` - Timing: `due_date`, `due_time`, `completed_at`, `created_at`, `updated_at` - Soft delete: `is_deleted` (filters via `SoftDeleteManager`) - Sync: `sync_id` (UUID for mobile sync) @@ -362,7 +362,7 @@ make test # Run tests in container ### Common Development Patterns -**Creating Recurring Tasks:** When a recurring task is marked complete, the next recurrence is automatically created in `tasks/models.py` `create_next_recurrence()` method. Celery task `process_recurring_tasks()` runs as safety net. +**Creating Recurring Tasks:** When a recurring task is marked complete, the next recurrence is automatically created in `tasks/models.py` `create_next_recurrence()` method, which calls `calculate_next_due_date()`. For `recurrence='custom'`, the next date is computed by evaluating `recurrence_rule` (an RRULE string) via `dateutil.rrule`; the web UI's Custom recurrence builder (in `templates/tasks/_recurrence_fields.html` and `static/js/app.js`) generates these strings for day-of-week, nth-weekday, and day-of-month patterns. Celery task `process_recurring_tasks()` runs as safety net. **Time Entry Workflow:** 1. `POST /api/tasks//start-timer/` creates TimeEntry with start_time diff --git a/README.md b/README.md index b334d56..36cf610 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A powerful Django-based task management system with time tracking, tag organizat - **Priority Levels**: Low, Medium, High, and Urgent - **Status Tracking**: Pending, In Progress, Completed, Cancelled - **Due Dates & Times**: Set specific due dates and times for tasks -- **Recurrence**: Daily, Weekly, Bi-weekly, Monthly, Yearly, and Custom patterns +- **Recurrence**: Daily, Weekly, Bi-weekly, Monthly, Yearly, plus Custom RRULE patterns (e.g. every other Wednesday, every second Tuesday, every 15th of the month) ### Organization - **Tag-Based System**: Organize tasks with multiple colored tags