MayanLongCount (Calendars v0.2.4) View Source

The MayanLongCount calendar module.

Link to this section Summary

Functions

Adds the number of days to a fixed day or MayanLongCount date.

Returns a fixed day or MayanLongCount date as a MayanLongCount date.

Returns a fixed day or MayanLongCount date as a fixed day.

Returns a fixed day or MayanLongCount date either as a fixed day or a MayanLongCount date.

Returns the baktun field of a MayanLongCount date.

Compares two MayanLongCount dates and returns...

Returns a MayanLongCount date from its fields baktun, katun, tun, uinal, kin.

Returns the difference (= number of days) between two MayanLongCount dates.

Returns true if MayanLongCount date1 is equal MayanLongCount date2, otherwise false.

Returns the name of the field atom in a MayanLongCount date at field_index.

Returns a list of the field atoms (names) of a MayanLongCount date.

Returns the number of fields in a MayanLongCount date

Returns the index (= position) of the field_atom in a MayanLongCount date.

Converts the other_date of the other_calendar into the equivalent date of the MayanLongCount calendar.

Converts a fixed day to a MayanLongCount date.

Converts a Julian Day into the equivalent MayanLongCount date.

Converts a RataDie date into the equivalent MayanLongCount date.

Converts a Unix date into the equivalent MayanLongCount date.

Returns true if MayanLongCount date1 is greater (= later) than or equal MayanLongCount date2, otherwise false.

Returns true if MayanLongCount date1 is greater (= later) than MayanLongCount date2, otherwise false.

Returns the katun field of a MayanLongCount date.

Returns the internal keyword of the MayanLongCount calendar.

Returns the kin field of a MayanLongCount date.

Returns true if MayanLongCount date1 is smaller (= earlier) than or equal MayanLongCount date2, otherwise false.

Returns true if MayanLongCount date1 is smaller (= earlier) than MayanLongCount date2, otherwise false.

Returns the module of the MayanLongCount calendar.

Returns the internal name of the MayanLongCount calendar.

Returns the distance between two MayanLongCount dates as a range of fixed days.

Returns the start of the day in the MayanLongCount calendar.

Converts a MayanLongCount date into the equivalent date of the other_calendar.

Converts a MayanLongCount date tuple into a fixed day.

Converts a MayanLongCount date given by baktun, katun, tun, uinal, kin into a fixed day.

Converts a MayanLongCount date into the equivalent Julian Day.

Converts a MayanLongCount date given by baktun, katun, tun, uinal, kin into the equivalent Julian Day.

Converts a MayanLongCount date into the equivalent RataDie date.

Converts a MayanLongCount date given by baktun, katun, tun, uinal, kin into the equivalent RataDie date.

Converts a MayanLongCount date into the equivalent Unix date.

Converts a MayanLongCount date given by baktun, katun, tun, uinal, kin into the equivalent Unix date.

Returns the current date either as a fixed day or a MayanLongCount date.

Returns the tun field of a MayanLongCount date.

Returns the uinal field of a MayanLongCount date.

Link to this section Types

Specs

fixed() :: integer()
Link to this type

mayan_long_count_baktun()

View Source

Specs

mayan_long_count_baktun() :: integer()
Link to this type

mayan_long_count_date()

View Source

Specs

Link to this type

mayan_long_count_katun()

View Source

Specs

mayan_long_count_katun() :: 0..19
Link to this type

mayan_long_count_kin()

View Source

Specs

mayan_long_count_kin() :: 1..19
Link to this type

mayan_long_count_tun()

View Source

Specs

mayan_long_count_tun() :: 0..17
Link to this type

mayan_long_count_uinal()

View Source

Specs

mayan_long_count_uinal() :: 0..19

Specs

Link to this section Functions

Link to this function

add_days(cal_date, days, type \\ :fixed)

View Source

Specs

add_days(fixed() | mayan_long_count_date(), integer(), :fixed | :date) ::
  fixed() | mayan_long_count_date()

Adds the number of days to a fixed day or MayanLongCount date.

If days is negative, the days will be subtracted.

The type parameter determines the type of the returned value:

  • :fixed returns a fixed day (default),
  • :date returns a MayanLongCount date.

Examples

  iex>Elixir.MayanLongCount.add_days(730739, 100)
  730839
  iex>Elixir.MayanLongCount.add_days(730739, -100)
  730639

  iex>Elixir.MayanLongCount.add_days(730739, 100, :fixed)
  730839
  iex>Elixir.MayanLongCount.add_days(730739, -100, :fixed)
  730639

  iex>Elixir.MayanLongCount.add_days(730739, 100, :date)
  {12, 19, 8, 15, 1}
  iex>Elixir.MayanLongCount.add_days(730739, -100, :date)
  {12, 19, 8, 5, 1}

  iex>Elixir.MayanLongCount.add_days({12, 19, 8, 10, 1}, 100)
  730839
  iex>Elixir.MayanLongCount.add_days({12, 19, 8, 10, 1}, -100)
  730639

  iex>Elixir.MayanLongCount.add_days({12, 19, 8, 10, 1}, 100, :fixed)
  730839
  iex>Elixir.MayanLongCount.add_days({12, 19, 8, 10, 1}, -100, :fixed)
  730639

  iex>Elixir.MayanLongCount.add_days({12, 19, 8, 10, 1}, 100, :date)
  {12, 19, 8, 15, 1}
  iex>Elixir.MayanLongCount.add_days({12, 19, 8, 10, 1}, -100, :date)
  {12, 19, 8, 5, 1}

Specs

Returns a fixed day or MayanLongCount date as a MayanLongCount date.

This is a convenience function to simplify certain function calls.

Examples

  iex>Elixir.MayanLongCount.as_date(730739)
  {12, 19, 8, 10, 1}
  iex>Elixir.MayanLongCount.as_date({12, 19, 8, 10, 1})
  {12, 19, 8, 10, 1}

Specs

as_fixed(fixed() | mayan_long_count_date()) :: fixed()

Returns a fixed day or MayanLongCount date as a fixed day.

This is a convenience function to simplify certain function calls.

Examples

  iex>Elixir.MayanLongCount.as_fixed(730739)
  730739
  iex>Elixir.MayanLongCount.as_fixed({12, 19, 8, 10, 1})
  730739
Link to this function

as_type(cal_date, type \\ :fixed)

View Source

Specs

as_type(fixed() | mayan_long_count_date(), :fixed | :date) ::
  fixed() | mayan_long_count_date()

Returns a fixed day or MayanLongCount date either as a fixed day or a MayanLongCount date.

The type parameter determines the type of the returned value:

  • :fixed returns a fixed day (default),
  • :date returns a MayanLongCount date.

Examples

  iex>Elixir.MayanLongCount.as_type(730739)
  730739
  iex>Elixir.MayanLongCount.as_type(730739, :fixed)
  730739
  iex>Elixir.MayanLongCount.as_type(730739, :date)
  {12, 19, 8, 10, 1}
  iex>Elixir.MayanLongCount.as_type({12, 19, 8, 10, 1})
  730739
  iex>Elixir.MayanLongCount.as_type({12, 19, 8, 10, 1}, :fixed)
  730739
  iex>Elixir.MayanLongCount.as_type({12, 19, 8, 10, 1}, :date)
  {12, 19, 8, 10, 1}
Link to this function

baktun(cal_date, type \\ :value)

View Source

Specs

baktun(fixed() | mayan_long_count_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the baktun field of a MayanLongCount date.

The type parameter determines the type of the returned baktun:

  • :atom returns the internal name of baktun,
  • :index returns the position of the baktun field within the date,
  • :name returns the common name of the baktun,
  • :value returns the value of the baktun (default).

Examples

  iex>Elixir.MayanLongCount.baktun(730739)
  12
  iex>Elixir.MayanLongCount.baktun(730739, :atom)
  :baktun
  iex>Elixir.MayanLongCount.baktun(730739, :index)
  0
  iex>Elixir.MayanLongCount.baktun(730739, :name)
  "Baktun"
  iex>Elixir.MayanLongCount.baktun(730739, :value)
  12

  iex>Elixir.MayanLongCount.baktun({12, 19, 8, 10, 1})
  12
  iex>Elixir.MayanLongCount.baktun({12, 19, 8, 10, 1}, :atom)
  :baktun
  iex>Elixir.MayanLongCount.baktun({12, 19, 8, 10, 1}, :index)
  0
  iex>Elixir.MayanLongCount.baktun({12, 19, 8, 10, 1}, :name)
  "Baktun"
  iex>Elixir.MayanLongCount.baktun({12, 19, 8, 10, 1}, :value)
  12

Specs

compare(mayan_long_count_date(), mayan_long_count_date()) :: :lt | :eq | :gt

Compares two MayanLongCount dates and returns...

  • :lt if date1 is smaller (= earlier) than date2,
  • :eq if date1 is equal date2,
  • :gt if date1 is larger (= later) than date2.

Examples

  iex>Elixir.MayanLongCount.compare({12, 19, 8, 10, 1}, {12, 19, 8, 10, 1})
  :eq
  iex>Elixir.MayanLongCount.compare({12, 19, 8, 10, 1}, {12, 19, 8, 15, 1})
  :lt
  iex>Elixir.MayanLongCount.compare({12, 19, 8, 15, 1}, {12, 19, 8, 10, 1})
  :gt
Link to this function

date(baktun, katun, tun, uinal, kin)

View Source

Specs

Returns a MayanLongCount date from its fields baktun, katun, tun, uinal, kin.

Example

  iex>Elixir.MayanLongCount.date(12, 19, 8, 10, 1)
  {12, 19, 8, 10, 1}
Link to this function

date_diff(cal_date1, cal_date2)

View Source

Specs

Returns the difference (= number of days) between two MayanLongCount dates.

The dates can be given as fixed days or MayanLongCount dates in arbitrary combination. The difference is calculated by date2 - date1.

If cal_date2 is larger (= later) than cal_date1 the result is positive.

If cal_date2 is smaller (= earlier) than cal_date1 the result is negative.

Examples

  iex>Elixir.MayanLongCount.date_diff(730739, 730839)
  100
  iex>Elixir.MayanLongCount.date_diff(730839, 730739)
  -100
  iex>Elixir.MayanLongCount.date_diff({12, 19, 8, 10, 1}, {12, 19, 8, 15, 1})
  100
  iex>Elixir.MayanLongCount.date_diff({12, 19, 8, 15, 1}, {12, 19, 8, 10, 1})
  -100
  iex>Elixir.MayanLongCount.date_diff(730739, {12, 19, 8, 15, 1})
  100
  iex>Elixir.MayanLongCount.date_diff({12, 19, 8, 10, 1}, 730839)
  100

Specs

Returns true if MayanLongCount date1 is equal MayanLongCount date2, otherwise false.

Examples

  iex>Elixir.MayanLongCount.eq({12, 19, 8, 10, 1}, {12, 19, 8, 10, 1})
  true
  iex>Elixir.MayanLongCount.eq({12, 19, 8, 10, 1}, {12, 19, 8, 15, 1})
  false
  iex>Elixir.MayanLongCount.eq({12, 19, 8, 15, 1}, {12, 19, 8, 10, 1})
  false

Specs

field_atom(integer()) :: atom()

Returns the name of the field atom in a MayanLongCount date at field_index.

Examples

  iex>Elixir.MayanLongCount.field_atom(0)
  :baktun
  iex>Elixir.MayanLongCount.field_atom(1)
  :katun
  iex>Elixir.MayanLongCount.field_atom(2)
  :tun
  iex>Elixir.MayanLongCount.field_atom(3)
  :uinal
  iex>Elixir.MayanLongCount.field_atom(4)
  :kin

Specs

field_atoms() :: [atom()]

Returns a list of the field atoms (names) of a MayanLongCount date.

Example

  iex>Elixir.MayanLongCount.field_atoms()
  [:baktun, :katun, :tun, :uinal, :kin]

Specs

field_count() :: integer()

Returns the number of fields in a MayanLongCount date

Example

  iex>Elixir.MayanLongCount.field_count()
  5

Specs

field_index(atom()) :: integer()

Returns the index (= position) of the field_atom in a MayanLongCount date.

Examples

  iex>Elixir.MayanLongCount.field_index(:baktun)
  0
  iex>Elixir.MayanLongCount.field_index(:katun)
  1
  iex>Elixir.MayanLongCount.field_index(:tun)
  2
  iex>Elixir.MayanLongCount.field_index(:uinal)
  3
  iex>Elixir.MayanLongCount.field_index(:kin)
  4
Link to this function

from_date(other_date, other_calendar)

View Source

Specs

from_date(tuple(), module()) :: mayan_long_count_date()
from_date(tuple(), module()) :: {:error, String.t()}

Converts the other_date of the other_calendar into the equivalent date of the MayanLongCount calendar.

Example

  iex>Elixir.MayanLongCount.from_date({2001, 9, 11}, Gregorian)
  {12, 19, 8, 10, 1}

Specs

from_fixed(fixed()) :: mayan_long_count_date()

Converts a fixed day to a MayanLongCount date.

Example

  iex>Elixir.MayanLongCount.from_fixed(730739)
  {12, 19, 8, 10, 1}

Specs

from_jd(tuple() | number()) :: mayan_long_count_date()

Converts a Julian Day into the equivalent MayanLongCount date.

The Julian Day can be given as a tuple or by a Julian day.

Examples

  iex>Elixir.MayanLongCount.from_jd({2452163.5})
  {12, 19, 8, 10, 1}
  iex>Elixir.MayanLongCount.from_jd(2452163.5)
  {12, 19, 8, 10, 1}

Specs

from_rata_die(tuple() | integer()) :: mayan_long_count_date()

Converts a RataDie date into the equivalent MayanLongCount date.

The RataDie date can be given as a tuple or by a RataDie rd.

Examples

  iex>Elixir.MayanLongCount.from_rata_die({730739})
  {12, 19, 8, 10, 1}
  iex>Elixir.MayanLongCount.from_rata_die(730739)
  {12, 19, 8, 10, 1}

Specs

from_unix(tuple() | integer()) :: mayan_long_count_date()

Converts a Unix date into the equivalent MayanLongCount date.

The Unix date can be given as a tuple or by Unix seconds.

Examples

  iex>Elixir.MayanLongCount.from_unix({1000166400})
  {12, 19, 8, 10, 1}
  iex>Elixir.MayanLongCount.from_unix(1000166400)
  {12, 19, 8, 10, 1}

Specs

Returns true if MayanLongCount date1 is greater (= later) than or equal MayanLongCount date2, otherwise false.

Examples

  iex>Elixir.MayanLongCount.ge({12, 19, 8, 10, 1}, {12, 19, 8, 10, 1})
  true
  iex>Elixir.MayanLongCount.ge({12, 19, 8, 10, 1}, {12, 19, 8, 15, 1})
  false
  iex>Elixir.MayanLongCount.ge({12, 19, 8, 15, 1}, {12, 19, 8, 10, 1})
  true

Specs

Returns true if MayanLongCount date1 is greater (= later) than MayanLongCount date2, otherwise false.

Examples

  iex>Elixir.MayanLongCount.gt({12, 19, 8, 10, 1}, {12, 19, 8, 10, 1})
  false
  iex>Elixir.MayanLongCount.gt({12, 19, 8, 10, 1}, {12, 19, 8, 15, 1})
  false
  iex>Elixir.MayanLongCount.gt({12, 19, 8, 15, 1}, {12, 19, 8, 10, 1})
  true
Link to this function

katun(cal_date, type \\ :value)

View Source

Specs

katun(fixed() | mayan_long_count_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the katun field of a MayanLongCount date.

The type parameter determines the type of the returned katun:

  • :atom returns the internal name of katun,
  • :index returns the position of the katun field within the date,
  • :name returns the common name of the katun,
  • :value returns the value of the katun (default).

Examples

  iex>Elixir.MayanLongCount.katun(730739)
  19
  iex>Elixir.MayanLongCount.katun(730739, :atom)
  :katun
  iex>Elixir.MayanLongCount.katun(730739, :index)
  1
  iex>Elixir.MayanLongCount.katun(730739, :name)
  "Katun"
  iex>Elixir.MayanLongCount.katun(730739, :value)
  19

  iex>Elixir.MayanLongCount.katun({12, 19, 8, 10, 1})
  19
  iex>Elixir.MayanLongCount.katun({12, 19, 8, 10, 1}, :atom)
  :katun
  iex>Elixir.MayanLongCount.katun({12, 19, 8, 10, 1}, :index)
  1
  iex>Elixir.MayanLongCount.katun({12, 19, 8, 10, 1}, :name)
  "Katun"
  iex>Elixir.MayanLongCount.katun({12, 19, 8, 10, 1}, :value)
  19

Specs

keyword() :: atom()

Returns the internal keyword of the MayanLongCount calendar.

Example

  iex>Elixir.MayanLongCount.keyword()
  :mayan_long_count
Link to this function

kin(cal_date, type \\ :value)

View Source

Specs

kin(fixed() | mayan_long_count_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the kin field of a MayanLongCount date.

The type parameter determines the type of the returned kin:

  • :atom returns the internal name of kin,
  • :index returns the position of the kin field within the date,
  • :name returns the common name of the kin,
  • :value returns the value of the kin (default).

Examples

  iex>Elixir.MayanLongCount.kin(730739)
  1
  iex>Elixir.MayanLongCount.kin(730739, :atom)
  :kin
  iex>Elixir.MayanLongCount.kin(730739, :index)
  4
  iex>Elixir.MayanLongCount.kin(730739, :name)
  "Kin"
  iex>Elixir.MayanLongCount.kin(730739, :value)
  1

  iex>Elixir.MayanLongCount.kin({12, 19, 8, 10, 1})
  1
  iex>Elixir.MayanLongCount.kin({12, 19, 8, 10, 1}, :atom)
  :kin
  iex>Elixir.MayanLongCount.kin({12, 19, 8, 10, 1}, :index)
  4
  iex>Elixir.MayanLongCount.kin({12, 19, 8, 10, 1}, :name)
  "Kin"
  iex>Elixir.MayanLongCount.kin({12, 19, 8, 10, 1}, :value)
  1

Specs

Returns true if MayanLongCount date1 is smaller (= earlier) than or equal MayanLongCount date2, otherwise false.

Examples

  iex>Elixir.MayanLongCount.le({12, 19, 8, 10, 1}, {12, 19, 8, 10, 1})
  true
  iex>Elixir.MayanLongCount.le({12, 19, 8, 10, 1}, {12, 19, 8, 15, 1})
  true
  iex>Elixir.MayanLongCount.le({12, 19, 8, 15, 1}, {12, 19, 8, 10, 1})
  false

Specs

Returns true if MayanLongCount date1 is smaller (= earlier) than MayanLongCount date2, otherwise false.

Examples

  iex>Elixir.MayanLongCount.lt({12, 19, 8, 10, 1}, {12, 19, 8, 10, 1})
  false
  iex>Elixir.MayanLongCount.lt({12, 19, 8, 10, 1}, {12, 19, 8, 15, 1})
  true
  iex>Elixir.MayanLongCount.lt({12, 19, 8, 15, 1}, {12, 19, 8, 10, 1})
  false

Specs

module() :: module()

Returns the module of the MayanLongCount calendar.

Example

  iex>Elixir.MayanLongCount.module()
  MayanLongCount

Specs

name() :: atom()

Returns the internal name of the MayanLongCount calendar.

Example

  iex>Elixir.MayanLongCount.name()
  "MayanLongCount"

Specs

Returns the distance between two MayanLongCount dates as a range of fixed days.

Example

  iex>Elixir.MayanLongCount.range({12, 19, 8, 10, 1}, {12, 19, 8, 15, 1})
  730739..730839

Specs

start_of_day() :: :midnight | :sunset | :sunrise | :noon

Returns the start of the day in the MayanLongCount calendar.

Possible return values are:

  • :midnight,
  • :noon,
  • :sunrise,
  • :sunset,

Example

  iex>Elixir.MayanLongCount.start_of_day()
  :midnight
Link to this function

to_date(date, other_calendar)

View Source

Specs

to_date(mayan_long_count_date(), module()) :: tuple()

Converts a MayanLongCount date into the equivalent date of the other_calendar.

For the following example to work the Gregorian calendar must be available.

Example

  iex>Elixir.MayanLongCount.to_date({12, 19, 8, 10, 1}, Gregorian)
  {2001, 9, 11}

Specs

to_fixed(mayan_long_count_date()) :: fixed()

Converts a MayanLongCount date tuple into a fixed day.

Example

  iex>Elixir.MayanLongCount.to_fixed({12, 19, 8, 10, 1})
  730739
Link to this function

to_fixed(baktun, katun, tun, uinal, kin)

View Source

Specs

Converts a MayanLongCount date given by baktun, katun, tun, uinal, kin into a fixed day.

Example

  iex>Elixir.MayanLongCount.to_fixed(12, 19, 8, 10, 1)
  730739

Specs

to_jd(mayan_long_count_date()) :: {number()}

Converts a MayanLongCount date into the equivalent Julian Day.

Example

  iex>Elixir.MayanLongCount.to_jd({12, 19, 8, 10, 1})
  {2452163.5}
Link to this function

to_jd(baktun, katun, tun, uinal, kin)

View Source

Specs

Converts a MayanLongCount date given by baktun, katun, tun, uinal, kin into the equivalent Julian Day.

Example

  iex>Elixir.MayanLongCount.to_jd(12, 19, 8, 10, 1)
  {2452163.5}

Specs

to_rata_die(mayan_long_count_date()) :: {integer()}

Converts a MayanLongCount date into the equivalent RataDie date.

Example

  iex>Elixir.MayanLongCount.to_rata_die({12, 19, 8, 10, 1})
  {730739}
Link to this function

to_rata_die(baktun, katun, tun, uinal, kin)

View Source

Specs

Converts a MayanLongCount date given by baktun, katun, tun, uinal, kin into the equivalent RataDie date.

Example

  iex>Elixir.MayanLongCount.to_rata_die(12, 19, 8, 10, 1)
  {730739}

Specs

to_unix(mayan_long_count_date()) :: {integer()}

Converts a MayanLongCount date into the equivalent Unix date.

Example

  iex>Elixir.MayanLongCount.to_unix({12, 19, 8, 10, 1})
  {1000166400}
Link to this function

to_unix(baktun, katun, tun, uinal, kin)

View Source

Specs

Converts a MayanLongCount date given by baktun, katun, tun, uinal, kin into the equivalent Unix date.

Example

  iex>Elixir.MayanLongCount.to_unix(12, 19, 8, 10, 1)
  {1000166400}

Specs

today(:fixed | :date) :: fixed() | mayan_long_count_date()

Returns the current date either as a fixed day or a MayanLongCount date.

(This cannot be doctested, because today is a moving target.)

The type parameter determines the type of the returned value:

  • :fixed returns a fixed day (default),
  • :date returns a MayanLongCount date.

Examples

  Elixir.MayanLongCount.today()
  730739
  Elixir.MayanLongCount.today(:fixed)
  730739
  Elixir.MayanLongCount.today(:date)
  {12, 19, 8, 10, 1}
Link to this function

tun(cal_date, type \\ :value)

View Source

Specs

tun(fixed() | mayan_long_count_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the tun field of a MayanLongCount date.

The type parameter determines the type of the returned tun:

  • :atom returns the internal name of tun,
  • :index returns the position of the tun field within the date,
  • :name returns the common name of the tun,
  • :value returns the value of the tun (default).

Examples

  iex>Elixir.MayanLongCount.tun(730739)
  8
  iex>Elixir.MayanLongCount.tun(730739, :atom)
  :tun
  iex>Elixir.MayanLongCount.tun(730739, :index)
  2
  iex>Elixir.MayanLongCount.tun(730739, :name)
  "Tun"
  iex>Elixir.MayanLongCount.tun(730739, :value)
  8

  iex>Elixir.MayanLongCount.tun({12, 19, 8, 10, 1})
  8
  iex>Elixir.MayanLongCount.tun({12, 19, 8, 10, 1}, :atom)
  :tun
  iex>Elixir.MayanLongCount.tun({12, 19, 8, 10, 1}, :index)
  2
  iex>Elixir.MayanLongCount.tun({12, 19, 8, 10, 1}, :name)
  "Tun"
  iex>Elixir.MayanLongCount.tun({12, 19, 8, 10, 1}, :value)
  8
Link to this function

uinal(cal_date, type \\ :value)

View Source

Specs

uinal(fixed() | mayan_long_count_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the uinal field of a MayanLongCount date.

The type parameter determines the type of the returned uinal:

  • :atom returns the internal name of uinal,
  • :index returns the position of the uinal field within the date,
  • :name returns the common name of the uinal,
  • :value returns the value of the uinal (default).

Examples

  iex>Elixir.MayanLongCount.uinal(730739)
  10
  iex>Elixir.MayanLongCount.uinal(730739, :atom)
  :uinal
  iex>Elixir.MayanLongCount.uinal(730739, :index)
  3
  iex>Elixir.MayanLongCount.uinal(730739, :name)
  "Uinal"
  iex>Elixir.MayanLongCount.uinal(730739, :value)
  10

  iex>Elixir.MayanLongCount.uinal({12, 19, 8, 10, 1})
  10
  iex>Elixir.MayanLongCount.uinal({12, 19, 8, 10, 1}, :atom)
  :uinal
  iex>Elixir.MayanLongCount.uinal({12, 19, 8, 10, 1}, :index)
  3
  iex>Elixir.MayanLongCount.uinal({12, 19, 8, 10, 1}, :name)
  "Uinal"
  iex>Elixir.MayanLongCount.uinal({12, 19, 8, 10, 1}, :value)
  10