MpxjEx.Calendar (MpxjEx v0.1.0)

Copy Markdown View Source

A working time calendar.

:days maps each weekday (:monday ... :sunday) to a map with a :type (:working, :non_working or :default, which means "inherit from the parent calendar") and :hours, a list of {from, to} Time tuples.

:exceptions lists the dates that differ from the normal week, each a map with :from and :to (Dates), :type, :hours, an optional :name and, for recurring exceptions, a :recurrence map.

:working_weeks lists alternative weeks for a date range, each a map with :name, :effective_from, :effective_to and :days.

Summary

Types

day()

@type day() :: %{type: day_type(), hours: [{Time.t(), Time.t()}]}

day_type()

@type day_type() :: :working | :non_working | :default

t()

@type t() :: %MpxjEx.Calendar{
  days: %{optional(atom()) => day()},
  exceptions: [map()],
  guid: String.t() | nil,
  minutes_per_day: integer() | nil,
  minutes_per_month: integer() | nil,
  minutes_per_week: integer() | nil,
  minutes_per_year: integer() | nil,
  name: String.t() | nil,
  parent_unique_id: integer() | nil,
  personal: boolean(),
  type: atom() | nil,
  unique_id: integer(),
  working_weeks: [map()]
}