BaliPawukon (Calendars v0.2.4) View Source

The BaliPawukon 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 BaliPawukon date as a BaliPawukon date.

Returns the asatawara field of a BaliPawukon date.

Returns the caturwara field of a BaliPawukon date.

Returns the dasawara field of a BaliPawukon date.

Returns a BaliPawukon date from its fields luang, dwiwara, triwara, caturwara, pancawara, sadwara, saptawara, asatawara, sangawara, dasawara.

Returns the dwiwara field of a BaliPawukon date.

Returns the epoch of the BaliPawukon calendar.

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

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

Returns the number of fields in a BaliPawukon date

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

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

Converts a fixed day to a BaliPawukon date.

Converts a Julian Day into the equivalent BaliPawukon date.

Converts a RataDie date into the equivalent BaliPawukon date.

Converts a Unix date into the equivalent BaliPawukon date.

Returns a list of the holidays of the BaliPawukon calendar.

Returns the fixed date of Kajeng Keliwon (first) of the BaliPawukon calendar in the given gregorian_year or [], if there is no such holiday in that year.

Returns the internal keyword of the BaliPawukon calendar.

Returns the luang field of a BaliPawukon date.

Returns the module of the BaliPawukon calendar.

Returns the internal name of the BaliPawukon calendar.

Returns the pancawara field of a BaliPawukon date.

Returns the sadwara field of a BaliPawukon date.

Returns the sangawara field of a BaliPawukon date.

Returns the saptawara field of a BaliPawukon date.

Returns the triwara field of a BaliPawukon date.

Returns the fixed date of Tumpek (first) of the BaliPawukon calendar in the given gregorian_year or [], if there is no such holiday in that year.

Link to this section Types

Link to this type

bali_pawukon_asatawara()

View Source

Specs

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

bali_pawukon_caturwara()

View Source

Specs

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

bali_pawukon_dasawara()

View Source

Specs

bali_pawukon_dasawara() :: integer()

Specs

Link to this type

bali_pawukon_dwiwara()

View Source

Specs

bali_pawukon_dwiwara() :: integer()

Specs

bali_pawukon_luang() :: boolean()
Link to this type

bali_pawukon_pancawara()

View Source

Specs

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

bali_pawukon_sadwara()

View Source

Specs

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

bali_pawukon_sangawara()

View Source

Specs

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

bali_pawukon_saptawara()

View Source

Specs

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

bali_pawukon_triwara()

View Source

Specs

bali_pawukon_triwara() :: integer()

Specs

fixed() :: integer()

Specs

Link to this section Functions

Specs

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

This is a convenience function to simplify certain function calls.

Examples

  iex>Elixir.BaliPawukon.as_date(730739)
  {true, 2, 2, 3, 5, 5, 3, 3, 2, 2}
  iex>Elixir.BaliPawukon.as_date({true, 2, 2, 3, 5, 5, 3, 3, 2, 2})
  {true, 2, 2, 3, 5, 5, 3, 3, 2, 2}
Link to this function

asatawara(cal_date, type \\ :value)

View Source

Specs

asatawara(fixed() | bali_pawukon_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the asatawara field of a BaliPawukon date.

The type parameter determines the type of the returned asatawara:

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

Examples

  iex>Elixir.BaliPawukon.asatawara(730739)
  3
  iex>Elixir.BaliPawukon.asatawara(730739, :atom)
  :asatawara
  iex>Elixir.BaliPawukon.asatawara(730739, :index)
  7
  iex>Elixir.BaliPawukon.asatawara(730739, :name)
  "Asatawara"
  iex>Elixir.BaliPawukon.asatawara(730739, :value)
  3

  iex>Elixir.BaliPawukon.asatawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2})
  3
  iex>Elixir.BaliPawukon.asatawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :atom)
  :asatawara
  iex>Elixir.BaliPawukon.asatawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :index)
  7
  iex>Elixir.BaliPawukon.asatawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :name)
  "Asatawara"
  iex>Elixir.BaliPawukon.asatawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :value)
  3
Link to this function

caturwara(cal_date, type \\ :value)

View Source

Specs

caturwara(fixed() | bali_pawukon_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the caturwara field of a BaliPawukon date.

The type parameter determines the type of the returned caturwara:

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

Examples

  iex>Elixir.BaliPawukon.caturwara(730739)
  3
  iex>Elixir.BaliPawukon.caturwara(730739, :atom)
  :caturwara
  iex>Elixir.BaliPawukon.caturwara(730739, :index)
  3
  iex>Elixir.BaliPawukon.caturwara(730739, :name)
  "Caturwara"
  iex>Elixir.BaliPawukon.caturwara(730739, :value)
  3

  iex>Elixir.BaliPawukon.caturwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2})
  3
  iex>Elixir.BaliPawukon.caturwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :atom)
  :caturwara
  iex>Elixir.BaliPawukon.caturwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :index)
  3
  iex>Elixir.BaliPawukon.caturwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :name)
  "Caturwara"
  iex>Elixir.BaliPawukon.caturwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :value)
  3
Link to this function

dasawara(cal_date, type \\ :value)

View Source

Specs

dasawara(fixed() | bali_pawukon_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the dasawara field of a BaliPawukon date.

The type parameter determines the type of the returned dasawara:

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

Examples

  iex>Elixir.BaliPawukon.dasawara(730739)
  2
  iex>Elixir.BaliPawukon.dasawara(730739, :atom)
  :dasawara
  iex>Elixir.BaliPawukon.dasawara(730739, :index)
  9
  iex>Elixir.BaliPawukon.dasawara(730739, :name)
  "Dasawara"
  iex>Elixir.BaliPawukon.dasawara(730739, :value)
  2

  iex>Elixir.BaliPawukon.dasawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2})
  2
  iex>Elixir.BaliPawukon.dasawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :atom)
  :dasawara
  iex>Elixir.BaliPawukon.dasawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :index)
  9
  iex>Elixir.BaliPawukon.dasawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :name)
  "Dasawara"
  iex>Elixir.BaliPawukon.dasawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :value)
  2
Link to this function

date(luang, dwiwara, triwara, caturwara, pancawara, sadwara, saptawara, asatawara, sangawara, dasawara)

View Source

Specs

Returns a BaliPawukon date from its fields luang, dwiwara, triwara, caturwara, pancawara, sadwara, saptawara, asatawara, sangawara, dasawara.

Example

  iex>Elixir.BaliPawukon.date(true, 2, 2, 3, 5, 5, 3, 3, 2, 2)
  {true, 2, 2, 3, 5, 5, 3, 3, 2, 2}
Link to this function

dwiwara(cal_date, type \\ :value)

View Source

Specs

dwiwara(fixed() | bali_pawukon_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the dwiwara field of a BaliPawukon date.

The type parameter determines the type of the returned dwiwara:

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

Examples

  iex>Elixir.BaliPawukon.dwiwara(730739)
  2
  iex>Elixir.BaliPawukon.dwiwara(730739, :atom)
  :dwiwara
  iex>Elixir.BaliPawukon.dwiwara(730739, :index)
  1
  iex>Elixir.BaliPawukon.dwiwara(730739, :name)
  "Dwiwara"
  iex>Elixir.BaliPawukon.dwiwara(730739, :value)
  2

  iex>Elixir.BaliPawukon.dwiwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2})
  2
  iex>Elixir.BaliPawukon.dwiwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :atom)
  :dwiwara
  iex>Elixir.BaliPawukon.dwiwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :index)
  1
  iex>Elixir.BaliPawukon.dwiwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :name)
  "Dwiwara"
  iex>Elixir.BaliPawukon.dwiwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :value)
  2

Specs

epoch() :: number()

Returns the epoch of the BaliPawukon calendar.

Example

  iex>Elixir.BaliPawukon.epoch()
  -1721279

Specs

field_atom(integer()) :: atom()

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

Examples

  iex>Elixir.BaliPawukon.field_atom(0)
  :luang
  iex>Elixir.BaliPawukon.field_atom(1)
  :dwiwara
  iex>Elixir.BaliPawukon.field_atom(2)
  :triwara
  iex>Elixir.BaliPawukon.field_atom(3)
  :caturwara
  iex>Elixir.BaliPawukon.field_atom(4)
  :pancawara
  iex>Elixir.BaliPawukon.field_atom(5)
  :sadwara
  iex>Elixir.BaliPawukon.field_atom(6)
  :saptawara
  iex>Elixir.BaliPawukon.field_atom(7)
  :asatawara
  iex>Elixir.BaliPawukon.field_atom(8)
  :sangawara
  iex>Elixir.BaliPawukon.field_atom(9)
  :dasawara

Specs

field_atoms() :: [atom()]

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

Example

  iex>Elixir.BaliPawukon.field_atoms()
  [:luang, :dwiwara, :triwara, :caturwara, :pancawara, :sadwara, :saptawara, :asatawara, :sangawara, :dasawara]

Specs

field_count() :: integer()

Returns the number of fields in a BaliPawukon date

Example

  iex>Elixir.BaliPawukon.field_count()
  10

Specs

field_index(atom()) :: integer()

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

Examples

  iex>Elixir.BaliPawukon.field_index(:luang)
  0
  iex>Elixir.BaliPawukon.field_index(:dwiwara)
  1
  iex>Elixir.BaliPawukon.field_index(:triwara)
  2
  iex>Elixir.BaliPawukon.field_index(:caturwara)
  3
  iex>Elixir.BaliPawukon.field_index(:pancawara)
  4
  iex>Elixir.BaliPawukon.field_index(:sadwara)
  5
  iex>Elixir.BaliPawukon.field_index(:saptawara)
  6
  iex>Elixir.BaliPawukon.field_index(:asatawara)
  7
  iex>Elixir.BaliPawukon.field_index(:sangawara)
  8
  iex>Elixir.BaliPawukon.field_index(:dasawara)
  9
Link to this function

from_date(other_date, other_calendar)

View Source

Specs

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

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

Example

  iex>Elixir.BaliPawukon.from_date({2001, 9, 11}, Gregorian)
  {true, 2, 2, 3, 5, 5, 3, 3, 2, 2}

Specs

from_fixed(fixed()) :: bali_pawukon_date()

Converts a fixed day to a BaliPawukon date.

Example

  iex>Elixir.BaliPawukon.from_fixed(730739)
  {true, 2, 2, 3, 5, 5, 3, 3, 2, 2}

Specs

from_jd(tuple() | number()) :: bali_pawukon_date()

Converts a Julian Day into the equivalent BaliPawukon date.

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

Examples

  iex>Elixir.BaliPawukon.from_jd({2452163.5})
  {true, 2, 2, 3, 5, 5, 3, 3, 2, 2}
  iex>Elixir.BaliPawukon.from_jd(2452163.5)
  {true, 2, 2, 3, 5, 5, 3, 3, 2, 2}

Specs

from_rata_die(tuple() | integer()) :: bali_pawukon_date()

Converts a RataDie date into the equivalent BaliPawukon date.

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

Examples

  iex>Elixir.BaliPawukon.from_rata_die({730739})
  {true, 2, 2, 3, 5, 5, 3, 3, 2, 2}
  iex>Elixir.BaliPawukon.from_rata_die(730739)
  {true, 2, 2, 3, 5, 5, 3, 3, 2, 2}

Specs

from_unix(tuple() | integer()) :: bali_pawukon_date()

Converts a Unix date into the equivalent BaliPawukon date.

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

Examples

  iex>Elixir.BaliPawukon.from_unix({1000166400})
  {true, 2, 2, 3, 5, 5, 3, 3, 2, 2}
  iex>Elixir.BaliPawukon.from_unix(1000166400)
  {true, 2, 2, 3, 5, 5, 3, 3, 2, 2}

Returns a list of the holidays of the BaliPawukon calendar.

The type parameter determines the type of the returned holidays:

  • :atom returns the internal names of the holidays,
  • :name returns the common names of the holidays (default).

Examples

  iex>Elixir.BaliPawukon.holidays()
  ["Kajeng Keliwon (first)", "Tumpek (first)"]
  iex>Elixir.BaliPawukon.holidays(:atom)
  [:kajeng_keliwon, :tumpek]
  iex>Elixir.BaliPawukon.holidays(:name)
  ["Kajeng Keliwon (first)", "Tumpek (first)"]
Link to this function

kajeng_keliwon(gregorian_year)

View Source

Specs

kajeng_keliwon(Gregorian.gregorian_year()) :: fixed() | bali_pawukon_date()

Returns the fixed date of Kajeng Keliwon (first) of the BaliPawukon calendar in the given gregorian_year or [], if there is no such holiday in that year.

The type parameter determines the type of the returned value:

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

Example

  iex>Elixir.BaliPawukon.kajeng_keliwon(2001)
  {2001, 1, 9}

Specs

keyword() :: atom()

Returns the internal keyword of the BaliPawukon calendar.

Example

  iex>Elixir.BaliPawukon.keyword()
  :bali_pawukon
Link to this function

luang(cal_date, type \\ :value)

View Source

Specs

luang(fixed() | bali_pawukon_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the luang field of a BaliPawukon date.

The type parameter determines the type of the returned luang:

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

Examples

  iex>Elixir.BaliPawukon.luang(730739)
  true
  iex>Elixir.BaliPawukon.luang(730739, :atom)
  :luang
  iex>Elixir.BaliPawukon.luang(730739, :index)
  0
  iex>Elixir.BaliPawukon.luang(730739, :name)
  "Luang"
  iex>Elixir.BaliPawukon.luang(730739, :value)
  true

  iex>Elixir.BaliPawukon.luang({true, 2, 2, 3, 5, 5, 3, 3, 2, 2})
  true
  iex>Elixir.BaliPawukon.luang({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :atom)
  :luang
  iex>Elixir.BaliPawukon.luang({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :index)
  0
  iex>Elixir.BaliPawukon.luang({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :name)
  "Luang"
  iex>Elixir.BaliPawukon.luang({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :value)
  true

Specs

module() :: module()

Returns the module of the BaliPawukon calendar.

Example

  iex>Elixir.BaliPawukon.module()
  BaliPawukon

Specs

name() :: atom()

Returns the internal name of the BaliPawukon calendar.

Example

  iex>Elixir.BaliPawukon.name()
  "BaliPawukon"
Link to this function

pancawara(cal_date, type \\ :value)

View Source

Specs

pancawara(fixed() | bali_pawukon_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the pancawara field of a BaliPawukon date.

The type parameter determines the type of the returned pancawara:

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

Examples

  iex>Elixir.BaliPawukon.pancawara(730739)
  5
  iex>Elixir.BaliPawukon.pancawara(730739, :atom)
  :pancawara
  iex>Elixir.BaliPawukon.pancawara(730739, :index)
  4
  iex>Elixir.BaliPawukon.pancawara(730739, :name)
  "Pancawara"
  iex>Elixir.BaliPawukon.pancawara(730739, :value)
  5

  iex>Elixir.BaliPawukon.pancawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2})
  5
  iex>Elixir.BaliPawukon.pancawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :atom)
  :pancawara
  iex>Elixir.BaliPawukon.pancawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :index)
  4
  iex>Elixir.BaliPawukon.pancawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :name)
  "Pancawara"
  iex>Elixir.BaliPawukon.pancawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :value)
  5
Link to this function

sadwara(cal_date, type \\ :value)

View Source

Specs

sadwara(fixed() | bali_pawukon_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the sadwara field of a BaliPawukon date.

The type parameter determines the type of the returned sadwara:

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

Examples

  iex>Elixir.BaliPawukon.sadwara(730739)
  5
  iex>Elixir.BaliPawukon.sadwara(730739, :atom)
  :sadwara
  iex>Elixir.BaliPawukon.sadwara(730739, :index)
  5
  iex>Elixir.BaliPawukon.sadwara(730739, :name)
  "Sadwara"
  iex>Elixir.BaliPawukon.sadwara(730739, :value)
  5

  iex>Elixir.BaliPawukon.sadwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2})
  5
  iex>Elixir.BaliPawukon.sadwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :atom)
  :sadwara
  iex>Elixir.BaliPawukon.sadwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :index)
  5
  iex>Elixir.BaliPawukon.sadwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :name)
  "Sadwara"
  iex>Elixir.BaliPawukon.sadwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :value)
  5
Link to this function

sangawara(cal_date, type \\ :value)

View Source

Specs

sangawara(fixed() | bali_pawukon_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the sangawara field of a BaliPawukon date.

The type parameter determines the type of the returned sangawara:

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

Examples

  iex>Elixir.BaliPawukon.sangawara(730739)
  2
  iex>Elixir.BaliPawukon.sangawara(730739, :atom)
  :sangawara
  iex>Elixir.BaliPawukon.sangawara(730739, :index)
  8
  iex>Elixir.BaliPawukon.sangawara(730739, :name)
  "Sangawara"
  iex>Elixir.BaliPawukon.sangawara(730739, :value)
  2

  iex>Elixir.BaliPawukon.sangawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2})
  2
  iex>Elixir.BaliPawukon.sangawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :atom)
  :sangawara
  iex>Elixir.BaliPawukon.sangawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :index)
  8
  iex>Elixir.BaliPawukon.sangawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :name)
  "Sangawara"
  iex>Elixir.BaliPawukon.sangawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :value)
  2
Link to this function

saptawara(cal_date, type \\ :value)

View Source

Specs

saptawara(fixed() | bali_pawukon_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the saptawara field of a BaliPawukon date.

The type parameter determines the type of the returned saptawara:

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

Examples

  iex>Elixir.BaliPawukon.saptawara(730739)
  3
  iex>Elixir.BaliPawukon.saptawara(730739, :atom)
  :saptawara
  iex>Elixir.BaliPawukon.saptawara(730739, :index)
  6
  iex>Elixir.BaliPawukon.saptawara(730739, :name)
  "Saptawara"
  iex>Elixir.BaliPawukon.saptawara(730739, :value)
  3

  iex>Elixir.BaliPawukon.saptawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2})
  3
  iex>Elixir.BaliPawukon.saptawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :atom)
  :saptawara
  iex>Elixir.BaliPawukon.saptawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :index)
  6
  iex>Elixir.BaliPawukon.saptawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :name)
  "Saptawara"
  iex>Elixir.BaliPawukon.saptawara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :value)
  3
Link to this function

triwara(cal_date, type \\ :value)

View Source

Specs

triwara(fixed() | bali_pawukon_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the triwara field of a BaliPawukon date.

The type parameter determines the type of the returned triwara:

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

Examples

  iex>Elixir.BaliPawukon.triwara(730739)
  2
  iex>Elixir.BaliPawukon.triwara(730739, :atom)
  :triwara
  iex>Elixir.BaliPawukon.triwara(730739, :index)
  2
  iex>Elixir.BaliPawukon.triwara(730739, :name)
  "Triwara"
  iex>Elixir.BaliPawukon.triwara(730739, :value)
  2

  iex>Elixir.BaliPawukon.triwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2})
  2
  iex>Elixir.BaliPawukon.triwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :atom)
  :triwara
  iex>Elixir.BaliPawukon.triwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :index)
  2
  iex>Elixir.BaliPawukon.triwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :name)
  "Triwara"
  iex>Elixir.BaliPawukon.triwara({true, 2, 2, 3, 5, 5, 3, 3, 2, 2}, :value)
  2

Specs

Returns the fixed date of Tumpek (first) of the BaliPawukon calendar in the given gregorian_year or [], if there is no such holiday in that year.

The type parameter determines the type of the returned value:

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

Example

  iex>Elixir.BaliPawukon.tumpek(2001)
  {2001, 2, 3}