Holidays v0.2.1 Holidays

Provides the on function that gives a list of holidays for a date within specified regions.

Dates in Erlang (and therefore Elixir) are represented by the tuple {year, month, day}.

Summary

Functions

Wrapper for Holidays.DateCalculator.Easter.gregorian_easter_for(year) so Definition modules don’t all need their own copy

Returns a list of holidays on the given date for the specified regions

Types

region :: atom
week :: :first | :second | :third | :fourth | :last
weekday ::
  :monday |
  :tuesday |
  :wednesday |
  :thursday |
  :friday |
  :saturday |
  :sunday

Functions

easter(year)

Wrapper for Holidays.DateCalculator.Easter.gregorian_easter_for(year) so Definition modules don’t all need their own copy.

For eample, in Holidays.Definitions.Us, Easter Sunday is defined like this:

holiday "Easter Sunday",
  %{regions: [:us],
    function: {Holidays, :easter, [:year]},
    type: :informal}
on(date, regions)

Specs

on(:calendar.date, [region]) :: list

Returns a list of holidays on the given date for the specified regions.

Examples

iex> Holidays.on({2016, 1, 1}, [:us])
[%{name: "New Year's Day"}]
start(type, args)