ICal.Alarm (iCal v2.0.0)

View Source

An iCalendar Alarm

Summary

Functions

Given a start and end date, returns when the alarm should be triggered next.

Given a component with alarms, return a list of the next set of alarms with their trigger times, if any.

Types

component_with_alarms()

@type component_with_alarms() :: %{
  :alarms => [t()],
  :dtstart => Date.t() | DateTime.t() | nil,
  optional(:dtend) => Date.t() | DateTime.t() | nil,
  optional(:rrule) => ICal.Recurrence.t() | nil
}

t()

@type t() :: %ICal.Alarm{
  action:
    ICal.Alarm.Audio.t()
    | ICal.Alarm.Display.t()
    | ICal.Alarm.Email.t()
    | ICal.Alarm.Custom.t(),
  custom_properties: ICal.custom_properties(),
  trigger: ICal.Alarm.Trigger.t()
}

Functions

next_activation(alarm, component)

Given a start and end date, returns when the alarm should be triggered next.

Returns nil if it should not be triggered.

next_alarms(component)

@spec next_alarms(component_with_alarms()) :: [{trigger_on :: DateTime.t(), t()}]

Given a component with alarms, return a list of the next set of alarms with their trigger times, if any.