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:
31
bin/utils.ml
31
bin/utils.ml
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user