Offlixir.Easter (offlixir v0.1.0)

Copy Markdown View Source

Easter Sunday in the Gregorian (Catholic and Protestant) and Orthodox traditions.

Summary

Functions

Returns Easter Sunday of year in the Gregorian computus.

Returns the number of days added to a Julian calendar date of year to get the Gregorian calendar date.

Returns Orthodox Easter Sunday of year as a Gregorian calendar date.

Functions

gregorian(year)

@spec gregorian(integer()) :: Date.t()

Returns Easter Sunday of year in the Gregorian computus.

iex> Offlixir.Easter.gregorian(2026)
~D[2026-04-05]

gregorian_shift(year)

@spec gregorian_shift(integer()) :: integer()

Returns the number of days added to a Julian calendar date of year to get the Gregorian calendar date.

The gap is valid for a date from the 1st of March of year to the end of February of the next year, which always holds for Easter. Before 1583 the Gregorian date is proleptic. The gap is negative before the year 200.

iex> Offlixir.Easter.gregorian_shift(2026)
13

orthodox(year)

@spec orthodox(integer()) :: Date.t()

Returns Orthodox Easter Sunday of year as a Gregorian calendar date.

The date is computed in the Julian calendar, then shifted by the gap between the two calendars (see gregorian_shift/1).

iex> Offlixir.Easter.orthodox(2026)
~D[2026-04-12]