Calendrical v0.1.2 Calendrical View Source

Calendrical provides calendar-related functions that build upon the conversion capabilities of Calendar available in Elixir from verison 1.5.0.

The conversion mechanism is based upon the definition of rata die as described in Calendrical Calculations by Dershowitz and Reingold. This rata die gives a numberical value to a moment in time that is idependent of any specific calendar. As a result libraries such as Calendrical can implement different calendars and calendar calculations in a conformant way.

Calendrical implements:

  • K-Day calculations in Calendrical.Kday (in the first release)

  • Additional Arithmetic calendar types (Julian calendar in the second release)

  • Astronomical calendar types (in a future release)

Link to this section Summary

Functions

Converts a %Date{} to a %NaiveDateTime{}

Converts a rata die to a %NaiveDateTime{}

Converts a %Date{} to a rata die

Converts a %NaiveDateTime{} to a rata die

Link to this section Functions

Link to this function date_from_rata_die(rata_die, calendar \\ Calendar.ISO) View Source

Converts a rata die to a %Date{}

Link to this function naive_datetime_from_date(date) View Source

Converts a %Date{} to a %NaiveDateTime{}

The time will be set to midnight.

Link to this function naive_datetime_from_rata_die(rata_die, calendar) View Source

Converts a rata die to a %NaiveDateTime{}

Link to this function rata_die_from_date(date) View Source

Converts a %Date{} to a rata die

Link to this function rata_die_from_naive_datetime(naive_date_time) View Source

Converts a %NaiveDateTime{} to a rata die