This is a elixir implementation of the holocene calendar, a calendar system for humans. If you do not yet know what the holocene calendar is I recommend watching this video from kurzgesagt.
If available in Hex, the package can be installed
by adding holocene_calendar
to your list of dependencies in mix.exs
:
def deps do
[
{:holocene_calendar, "~> 0.1.0"}
]
end
Converting a Date
from the ISO calendar implementation to the holocene calendar:
iex> ~D[2019-01-01] |> Date.convert(HoloceneCalendar)
{:ok, %Date{calendar: HoloceneCalendar, day: 1, month: 1, year: 12019}}
Or use it directly:
iex> %Date{calendar: HoloceneCalendar, day: 1, month: 1, year: 12019} |> Date.to_string
"12019-01-01"
Also have a look into the Calendar behaviour to get more infos on what you can do with this calendar implementation.
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/holocene_calendar.