AkanDayName (Calendars v0.2.4) View Source
The AkanDayName
calendar module.
This is a cyclical calendar. So it is not possible to convert a 'date' of this calendar into a corresponding date of a monotonic or another cyclical calendar.
Link to this section Summary
Functions
Returns a fixed day or AkanDayName date as a AkanDayName date.
Returns a AkanDayName date from its fields prefix, stem
.
Returns the epoch of the AkanDayName calendar.
Returns the name of the field atom in a AkanDayName date at field_index
.
Returns a list of the field atoms (names) of a AkanDayName date.
Returns the number of fields in a AkanDayName date
Returns the index (= position) of the field_atom
in a AkanDayName date.
Converts the other_date
of the other_calendar
into the equivalent date of the AkanDayName calendar.
Converts a fixed day to a AkanDayName
date.
Converts a Julian Day into the equivalent AkanDayName date.
Converts a RataDie date into the equivalent AkanDayName date.
Converts a Unix date into the equivalent AkanDayName date.
Returns the internal keyword of the AkanDayName calendar.
Returns the module of the AkanDayName calendar.
Returns the internal name of the AkanDayName calendar.
Returns the prefix
field of a AkanDayName date.
Returns the stem
field of a AkanDayName date.
Link to this section Types
Specs
akan_day_name_date() :: {akan_day_name_prefix(), akan_day_name_stem()}
Specs
akan_day_name_prefix() :: 1..6
Specs
akan_day_name_stem() :: 1..7
Specs
fixed() :: integer()
Specs
t() :: akan_day_name_date()
Link to this section Functions
Specs
as_date(fixed() | akan_day_name_date()) :: akan_day_name_date()
Returns a fixed day or AkanDayName date as a AkanDayName date.
This is a convenience function to simplify certain function calls.
Examples
iex>Elixir.AkanDayName.as_date(730739)
{4, 7}
iex>Elixir.AkanDayName.as_date({4, 7})
{4, 7}
Specs
date(akan_day_name_prefix(), akan_day_name_stem()) :: t()
Returns a AkanDayName date from its fields prefix, stem
.
Example
iex>Elixir.AkanDayName.date(4, 7)
{4, 7}
Specs
epoch() :: number()
Returns the epoch of the AkanDayName calendar.
Example
iex>Elixir.AkanDayName.epoch()
37
Specs
Returns the name of the field atom in a AkanDayName date at field_index
.
Examples
iex>Elixir.AkanDayName.field_atom(0)
:prefix
iex>Elixir.AkanDayName.field_atom(1)
:stem
Specs
field_atoms() :: [atom()]
Returns a list of the field atoms (names) of a AkanDayName date.
Example
iex>Elixir.AkanDayName.field_atoms()
[:prefix, :stem]
Specs
field_count() :: integer()
Returns the number of fields in a AkanDayName date
Example
iex>Elixir.AkanDayName.field_count()
2
Specs
Returns the index (= position) of the field_atom
in a AkanDayName date.
Examples
iex>Elixir.AkanDayName.field_index(:prefix)
0
iex>Elixir.AkanDayName.field_index(:stem)
1
Specs
from_date(tuple(), module()) :: akan_day_name_date()
from_date(tuple(), module()) :: {:error, String.t()}
Converts the other_date
of the other_calendar
into the equivalent date of the AkanDayName calendar.
Example
iex>Elixir.AkanDayName.from_date({2001, 9, 11}, Gregorian)
{4, 7}
Specs
from_fixed(fixed()) :: akan_day_name_date()
Converts a fixed day to a AkanDayName
date.
Example
iex>Elixir.AkanDayName.from_fixed(730739)
{4, 7}
Specs
from_jd(tuple() | number()) :: akan_day_name_date()
Converts a Julian Day into the equivalent AkanDayName date.
The Julian Day can be given as a tuple or by a Julian day
.
Examples
iex>Elixir.AkanDayName.from_jd({2452163.5})
{4, 7}
iex>Elixir.AkanDayName.from_jd(2452163.5)
{4, 7}
Specs
from_rata_die(tuple() | integer()) :: akan_day_name_date()
Converts a RataDie date into the equivalent AkanDayName date.
The RataDie date can be given as a tuple or by a RataDie rd
.
Examples
iex>Elixir.AkanDayName.from_rata_die({730739})
{4, 7}
iex>Elixir.AkanDayName.from_rata_die(730739)
{4, 7}
Specs
from_unix(tuple() | integer()) :: akan_day_name_date()
Converts a Unix date into the equivalent AkanDayName date.
The Unix date can be given as a tuple or by Unix seconds
.
Examples
iex>Elixir.AkanDayName.from_unix({1000166400})
{4, 7}
iex>Elixir.AkanDayName.from_unix(1000166400)
{4, 7}
Specs
keyword() :: atom()
Returns the internal keyword of the AkanDayName calendar.
Example
iex>Elixir.AkanDayName.keyword()
:akan_day_name
Specs
module() :: module()
Returns the module of the AkanDayName calendar.
Example
iex>Elixir.AkanDayName.module()
AkanDayName
Specs
name() :: atom()
Returns the internal name of the AkanDayName calendar.
Example
iex>Elixir.AkanDayName.name()
"AkanDayName"
Specs
prefix(fixed() | akan_day_name_date(), :atom | :index | :name | :value) :: :atom | integer() | String.t() | number()
Returns the prefix
field of a AkanDayName date.
The type
parameter determines the type of the returned prefix:
:atom
returns the internal name of prefix,:index
returns the position of the prefix field within the date,:name
returns the common name of the prefix,:value
returns the value of the prefix (default).
Examples
iex>Elixir.AkanDayName.prefix(730739)
4
iex>Elixir.AkanDayName.prefix(730739, :atom)
:prefix
iex>Elixir.AkanDayName.prefix(730739, :index)
0
iex>Elixir.AkanDayName.prefix(730739, :name)
"Prefix"
iex>Elixir.AkanDayName.prefix(730739, :value)
4
iex>Elixir.AkanDayName.prefix({4, 7})
4
iex>Elixir.AkanDayName.prefix({4, 7}, :atom)
:prefix
iex>Elixir.AkanDayName.prefix({4, 7}, :index)
0
iex>Elixir.AkanDayName.prefix({4, 7}, :name)
"Prefix"
iex>Elixir.AkanDayName.prefix({4, 7}, :value)
4
Specs
stem(fixed() | akan_day_name_date(), :atom | :index | :name | :value) :: :atom | integer() | String.t() | number()
Returns the stem
field of a AkanDayName date.
The type
parameter determines the type of the returned stem:
:atom
returns the internal name of stem,:index
returns the position of the stem field within the date,:name
returns the common name of the stem,:value
returns the value of the stem (default).
Examples
iex>Elixir.AkanDayName.stem(730739)
7
iex>Elixir.AkanDayName.stem(730739, :atom)
:stem
iex>Elixir.AkanDayName.stem(730739, :index)
1
iex>Elixir.AkanDayName.stem(730739, :name)
"Stem"
iex>Elixir.AkanDayName.stem(730739, :value)
7
iex>Elixir.AkanDayName.stem({4, 7})
7
iex>Elixir.AkanDayName.stem({4, 7}, :atom)
:stem
iex>Elixir.AkanDayName.stem({4, 7}, :index)
1
iex>Elixir.AkanDayName.stem({4, 7}, :name)
"Stem"
iex>Elixir.AkanDayName.stem({4, 7}, :value)
7