feat: add location and description fields to reminders
This commit is contained in:
16
bin/utils.ml
16
bin/utils.ml
@@ -190,6 +190,22 @@ let get_recurrence_id ev =
|
||||
| _ -> None)
|
||||
ev.props
|
||||
|
||||
let get_location ev =
|
||||
List.find_map
|
||||
(fun prop ->
|
||||
match prop with
|
||||
| `Location (_, loc) -> Some loc
|
||||
| _ -> None)
|
||||
ev.props
|
||||
|
||||
let get_description ev =
|
||||
List.find_map
|
||||
(fun prop ->
|
||||
match prop with
|
||||
| `Description (_, desc) -> Some desc
|
||||
| _ -> None)
|
||||
ev.props
|
||||
|
||||
let separate_master_and_recurrence (events : Icalendar.event list) : Icalendar.event * Icalendar.event list =
|
||||
(* List.iteri (fun i e -> Printf.eprintf "%02d: %s\n" (i + 1) (Icalendar.show_component (`Event e))) events; *)
|
||||
let recur_ids = List.map (fun ev -> (ev, get_recurrence_id ev)) events in
|
||||
|
||||
Reference in New Issue
Block a user