vobject v0.5.0 ICalendar.Decoder View Source
Link to this section Summary
Functions
This function extracts parameter data from a key in an iCalendar string
This function is designed to parse iCal datetime strings into erlang dates
This function should strip any sanitization that has been applied to content within an iCal string
Link to this section Functions
This function extracts parameter data from a key in an iCalendar string.
iex> ICalendar.Decoder.retrieve_params(
...> "DTSTART;TZID=America/Chicago")
["DTSTART", %{tzid: "America/Chicago"}]
It should be able to handle multiple parameters per key:
iex> ICalendar.Decoder.retrieve_params(
...> "KEY;LOREM=ipsum;DOLOR=sit")
["KEY", %{lorem: "ipsum", dolor: "sit"}]
This function is designed to parse iCal datetime strings into erlang dates.
It should be able to handle dates from the past:
iex> {:ok, date} = ICalendar.Decoder.to_datetime("19930407T153022Z")
...> Timex.to_erl(date)
{{1993, 4, 7}, {15, 30, 22}}
As well as the future:
iex> {:ok, date} = ICalendar.Decoder.to_datetime("39930407T153022Z")
...> Timex.to_erl(date)
{{3993, 4, 7}, {15, 30, 22}}
And should return error for incorrect dates:
iex> ICalendar.Decoder.to_datetime("1993/04/07")
{:error, :invalid_format}
It should handle timezones from the Olson Database:
iex> {:ok, date} = ICalendar.Decoder.to_datetime("19980119T020000",
...> %{tzid: "America/Chicago"})
...> [Timex.to_erl(date), date.time_zone]
[{{1998, 1, 19}, {2, 0, 0}}, "America/Chicago"]
This function should strip any sanitization that has been applied to content within an iCal string.
iex> ICalendar.Decoder.unescape(~s(lorem\\, ipsum))
"lorem, ipsum"