Command-line and Emacs Calendar Client
1(** Core event functionality and data access *) 2 3type event_id = string 4(** Event ID type *) 5 6type t 7(** Event type representing a calendar event *) 8 9type date_error = [ `Msg of string ] 10 11val create : 12 summary:string -> 13 start:Icalendar.date_or_datetime -> 14 ?end_: 15 [ `Duration of Icalendar.params * Ptime.Span.t 16 | `Dtend of Icalendar.params * Icalendar.date_or_datetime ] -> 17 ?location:string -> 18 ?description:string -> 19 ?recurrence:Icalendar.recurrence -> 20 Collection.t -> 21 t 22(** Create a new event with required properties. 23 24 The start and end times can be specified as Icalendar.timestamp values, 25 which allows for directly using any of the three RFC5545 time formats: 26 - `Utc time: Fixed to absolute UTC time 27 - `Local time: Floating local time (follows user's timezone) 28 - `With_tzid (time, timezone): Local time with timezone reference *) 29 30val edit : 31 ?summary:string -> 32 ?start:Icalendar.date_or_datetime -> 33 ?end_: 34 [ `Duration of Icalendar.params * Ptime.Span.t 35 | `Dtend of Icalendar.params * Icalendar.date_or_datetime ] -> 36 ?location:string -> 37 ?description:string -> 38 ?recurrence:Icalendar.recurrence -> 39 t -> 40 t 41(** Edit an existing event. *) 42 43val of_icalendar : Collection.t -> file_name:string -> Icalendar.event -> t 44(** Convert an Icalendar event to our event type. *) 45 46val to_icalendar : t -> Icalendar.event 47(** Convert our event type to an Icalendar event *) 48 49val get_id : t -> event_id 50val get_summary : t -> string option 51 52val get_start : t -> Ptime.t 53(** Get the start time of an event. Note that local times are converted to UTC 54 based on their timezone information. If no timezone is specified, the system 55 timezone is used. *) 56 57val get_end : t -> Ptime.t option 58(** Get the end time of an event. Like get_start, times are converted to UTC 59 based on timezone information. Returns None if the event doesn't have an end 60 time. *) 61 62val is_date : t -> bool 63(** Returns true if either the start or end timestamp is specified as a date 64 instead of a datetime. *) 65 66val get_start_timezone : t -> string option 67val get_end_timezone : t -> string option 68val get_duration : t -> Ptime.span option 69val get_location : t -> string option 70val get_description : t -> string option 71val get_recurrence : t -> Icalendar.recurrence option 72val get_collection : t -> Collection.t 73 74val get_file_path : 75 fs:'a Eio.Path.t -> calendar_dir_path:string -> t -> 'a Eio.Path.t