calendaring_jmap.convert.ical_to_jscal module#
iCalendar to JSCalendar conversion (RFC 5545 to RFC 8984).
- Public API:
ical_to_jscal(ical_str, calendar_id=None) -> dict
The output dict is a raw JSCalendar CalendarEvent object suitable for passing directly to CalendarEvent/set.
- calendaring_jmap.convert.ical_to_jscal.ical_to_jscal(ical_str, calendar_id=None)[source]#
Convert an iCalendar string to a JSCalendar CalendarEvent dict (RFC 8984).
Processes the first VEVENT found in the string. Any sibling VEVENTs with a RECURRENCE-ID are folded into the
recurrenceOverridesmap of the master event. EXDATE entries are also added torecurrenceOverrides.- Parameters:
- Return type:
- Returns:
Raw JSCalendar dict suitable for passing directly to
CalendarEvent/set.- Raises:
ValueError – If no VEVENT component is found; the master VEVENT is missing
UIDorDTSTART(both mandatory per RFC 5545, but not every producer enforces this);DTSTART/DTENDhave mismatched value types, oneDATEand oneDATE-TIME(RFC 5545 Section 3.8.2.2 requires both to match, andDTENDto be later in time thanDTSTART); orDTEND/DURATIONresolves to beforeDTSTART(RFC 8984 Section 5.1.2 requiresdurationto be zero or positive).