View Source Easter (Easter v1.0.0)

Functions for getting the date of Easter.

Link to this section Summary

Functions

Gets the date of Easter on a given year.

Gets the date of Easter on a given year.

Link to this section Functions

@spec get_date(integer()) :: {:ok, Date.t()} | {:error, atom()}

Gets the date of Easter on a given year.

examples

Examples

iex> Easter.get_date(2023)
{:ok, ~D[2023-04-09]}

iex> Easter.get_date(10_000)
{:error, :invalid_date}
@spec get_date!(integer()) :: Date.t()

Gets the date of Easter on a given year.

examples

Examples

iex> Easter.get_date!(2023)
~D[2023-04-09]

iex> Easter.get_date!(10_000)
** (ArgumentError) cannot get Easter date, reason: invalid_date