View Source Naiveical.Creator.Icalendar (Naiveical v1.0.0)
Helper functions to create icalender elements.
Link to this section Summary
Functions
Build complete VCALENDAR with all components and VTIMEZONEs.
Creates a VCALENDAR object.
Creates a new VEVENT object.
Creates a new VTODO object.
Link to this section Functions
Link to this function
build_aggregated_vcalendar(components, vtimezones, displayname \\ nil)
View Source@spec build_aggregated_vcalendar( [String.t()], %{optional(String.t()) => String.t()}, String.t() | nil ) :: String.t()
Build complete VCALENDAR with all components and VTIMEZONEs.
Creates a fully-formed VCALENDAR object containing:
- Standard VCALENDAR headers (VERSION, PRODID)
- Optional X-WR-CALNAME for calendar display name (Apple/Mozilla extension)
- All VTIMEZONE components (deduplicated by timezone ID)
- All calendar components (VEVENT, VTODO, etc.)
parameters
Parameters
components- List of calendar component strings (VEVENT, VTODO, etc.)vtimezones- Map of timezone ID to VTIMEZONE component stringsdisplayname- Optional calendar display name (default: nil)
returns
Returns
A complete VCALENDAR string with proper CRLF line endings.
examples
Examples
iex> components = ["BEGIN:VEVENT\nUID:123\n...\nEND:VEVENT"]
iex> vtimezones = %{"America/New_York" => "BEGIN:VTIMEZONE\n...\nEND:VTIMEZONE"}
iex> build_aggregated_vcalendar(components, vtimezones, "My Calendar")
"BEGIN:VCALENDAR\r\n..."
@spec create_valert(String.t(), Date.t() | NaiveDateTime.t() | DateTime.t()) :: String.t()
Creates a VCALENDAR object.
Link to this function
create_vevent(summary, dtstart, dtend, location \\ "", description \\ "", class \\ "PUBLIC")
View Source@spec create_vevent( String.t(), DateTime.t(), DateTime.t(), String.t(), String.t(), String.t() ) :: String.t()
Creates a new VEVENT object.
Link to this function
create_vtodo(summary, due, dtstamp \\ DateTime.utc_now(), opts \\ [])
View Source@spec create_vtodo( String.t(), Date.t() | DateTime.t() | String.t(), DateTime.t() | String.t(), Keyword.t() ) :: String.t()
Creates a new VTODO object.