feat(remind): add yearly simple date recurrence handling

Add `yearly_simple_date` collector that detects simple yearly
recurrences (`RRULE:FREQ=YEARLY` with no extra constraints) and stores
the month/day pair in a new `simple_yearly` field on `Remind.rem`.

When rendering, events with `simple_yearly` set are emitted as
`REM <Month> <Day> MSG <summary>` instead of the full dated form.

Add `month_of_int` and `string_of_month` helpers in `Utils`, and update
the RRULE dataset comment with UIDs for easier debugging.
This commit is contained in:
2026-05-15 10:52:17 +02:00
parent c78d94e004
commit 33dee76b4c
3 changed files with 104 additions and 45 deletions

View File

@@ -1,6 +1,37 @@
open Remind_sync
open Icalendar
type months = Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec
let month_of_int = function
| 1 -> Jan
| 2 -> Feb
| 3 -> Mar
| 4 -> Apr
| 5 -> May
| 6 -> Jun
| 7 -> Jul
| 8 -> Aug
| 9 -> Sep
| 10 -> Oct
| 11 -> Nov
| 12 -> Dec
| _ -> failwith "Invalid month number"
let string_of_month = function
| Jan -> "Jan"
| Feb -> "Feb"
| Mar -> "Mar"
| Apr -> "Apr"
| May -> "May"
| Jun -> "Jun"
| Jul -> "Jul"
| Aug -> "Aug"
| Sep -> "Sep"
| Oct -> "Oct"
| Nov -> "Nov"
| Dec -> "Dec"
let spf = Printf.sprintf
let get_uid ev =