holidefs v0.2.0 Holidefs.DateCalculator View Source

Some functions to calculate dynamic holiday dates

Link to this section Summary

Functions

Returns the first day of the given month on the given year

Returns the date of Easter for the given year

Returns the date of Orthodox Easter for the given year

Returns the date of Orthodox Easter for the given year

Returns the next day of week after the given day

Returns the nth day of the week

Returns the previous day of week after the given day

Link to this section Functions

Link to this function beginning_of_month(year, month) View Source
beginning_of_month(integer(), integer()) :: Date.t()

Returns the first day of the given month on the given year

Link to this function gregorian_easter(year) View Source
gregorian_easter(integer()) :: Date.t()

Returns the date of Easter for the given year

Examples

iex> Holidefs.DateCalculator.gregorian_easter(2016)
~D[2016-03-27]

iex> Holidefs.DateCalculator.gregorian_easter(2015)
~D[2015-04-05]
Link to this function gregorian_orthodox_easter(year) View Source
gregorian_orthodox_easter(integer()) :: Date.t()

Returns the date of Orthodox Easter for the given year

Examples

iex> Holidefs.DateCalculator.gregorian_orthodox_easter(2016)
~D[2016-05-01]

iex> Holidefs.DateCalculator.gregorian_orthodox_easter(2015)
~D[2015-04-12]
Link to this function julian_orthodox_easter(year) View Source
julian_orthodox_easter(integer()) :: Date.t()

Returns the date of Orthodox Easter for the given year

Examples

iex> Holidefs.DateCalculator.julian_orthodox_easter(2016)
~D[2016-04-18]

iex> Holidefs.DateCalculator.julian_orthodox_easter(2015)
~D[2015-03-30]
Link to this function next_day_of_week(date, day_of_week) View Source
next_day_of_week(Date.t(), integer()) :: Date.t()

Returns the next day of week after the given day

Link to this function nth_day_of_week(year, month, week, weekday) View Source
nth_day_of_week(integer(), integer(), integer(), integer()) :: Date.t()

Returns the nth day of the week

Link to this function previous_day_of_week(date, day_of_week) View Source
previous_day_of_week(Date.t(), integer()) :: Date.t()

Returns the previous day of week after the given day