Icelandic (Calendars v0.2.4) View Source

The Icelandic calendar module.

Link to this section Summary

Functions

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

Returns the month agust of the Icelandic calendar.

Returns the month april of the Icelandic calendar.

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

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

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

Compares two Icelandic dates and returns...

Returns a Icelandic date from its fields year, season, week, weekday.

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

Returns the month desember of the Icelandic calendar.

Returns the epoch of the Icelandic calendar.

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

Returns the month februar of the Icelandic calendar.

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

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

Returns the number of fields in a Icelandic date

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

Returns the weekday friday of the Icelandic calendar.

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

Converts a fixed day to a Icelandic date.

Converts a Julian Day into the equivalent Icelandic date.

Converts a RataDie date into the equivalent Icelandic date.

Converts a Unix date into the equivalent Icelandic date.

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

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

Returns the start of summer in the given icelandic_year.

Returns the start of winter in the given icelandic_year.

Returns the month januar of the Icelandic calendar.

Returns the month juli of the Icelandic calendar.

Returns the month juni of the Icelandic calendar.

Returns the internal keyword of the Icelandic calendar.

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

Returns true if the Icelandic year is a leap year, otherwise false.

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

Returns the month mai of the Icelandic calendar.

Returns the month mar of the Icelandic calendar.

Returns the module of the Icelandic calendar.

Returns the weekday monday of the Icelandic calendar.

Returns the month of the given icelandic_date.

Returns a list of the months of the Icelandic calendar.

Returns the internal name of the Icelandic calendar.

Returns the month november of the Icelandic calendar.

Returns the month oktober of the Icelandic calendar.

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

Returns the weekday saturday of the Icelandic calendar.

Returns the season field of a Icelandic date.

Returns the month september of the Icelandic calendar.

Returns the start of the day in the Icelandic calendar.

Returns the weekday sunday of the Icelandic calendar.

Returns the weekday thursady of the Icelandic calendar.

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

Converts a Icelandic date tuple into a fixed day.

Converts a Icelandic date given by year, season, week, weekday into a fixed day.

Converts a Icelandic date into the equivalent Julian Day.

Converts a Icelandic date given by year, season, week, weekday into the equivalent Julian Day.

Converts a Icelandic date into the equivalent RataDie date.

Converts a Icelandic date given by year, season, week, weekday into the equivalent RataDie date.

Converts a Icelandic date into the equivalent Unix date.

Converts a Icelandic date given by year, season, week, weekday into the equivalent Unix date.

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

Returns the weekday tuesday of the Icelandic calendar.

Returns the weekday wednesday of the Icelandic calendar.

Returns the week field of a Icelandic date.

Returns the weekday field of a Icelandic date.

Returns a list of the weekdays of the Icelandic calendar.

Returns the year field of a Icelandic date.

Link to this section Types

Specs

fixed() :: integer()

Specs

Specs

icelandic_season() :: 0..360

Specs

icelandic_week() :: 1..27

Specs

icelandic_weekday() :: 0..6

Specs

icelandic_year() :: integer()

Specs

t() :: icelandic_date()

Link to this section Functions

Link to this function

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

View Source

Specs

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

Adds the number of days to a fixed day or Icelandic 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 Icelandic date.

Examples

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

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

  iex>Elixir.Icelandic.add_days(730739, 100, :date)
  {2001, 270, 8, 4}
  iex>Elixir.Icelandic.add_days(730739, -100, :date)
  {2001, 90, 7, 0}

  iex>Elixir.Icelandic.add_days({2001, 90, 21, 2}, 100)
  730839
  iex>Elixir.Icelandic.add_days({2001, 90, 21, 2}, -100)
  730639

  iex>Elixir.Icelandic.add_days({2001, 90, 21, 2}, 100, :fixed)
  730839
  iex>Elixir.Icelandic.add_days({2001, 90, 21, 2}, -100, :fixed)
  730639

  iex>Elixir.Icelandic.add_days({2001, 90, 21, 2}, 100, :date)
  {2001, 270, 8, 4}
  iex>Elixir.Icelandic.add_days({2001, 90, 21, 2}, -100, :date)
  {2001, 90, 7, 0}

Specs

agust(:integer | :name) :: integer()

Returns the month agust of the Icelandic calendar.

The type parameter determines the type of the returned month:

  • :integer returns the number of the month (default),
  • :name returns the name of the month.

Examples

  iex>Elixir.Icelandic.agust()
  8
  iex>Elixir.Icelandic.agust(:integer)
  8
  iex>Elixir.Icelandic.agust(:name)
  "Ágúst"

Specs

april(:integer | :name) :: integer()

Returns the month april of the Icelandic calendar.

The type parameter determines the type of the returned month:

  • :integer returns the number of the month (default),
  • :name returns the name of the month.

Examples

  iex>Elixir.Icelandic.april()
  4
  iex>Elixir.Icelandic.april(:integer)
  4
  iex>Elixir.Icelandic.april(:name)
  "Apríl"

Specs

as_date(fixed() | icelandic_date()) :: icelandic_date()

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

This is a convenience function to simplify certain function calls.

Examples

  iex>Elixir.Icelandic.as_date(730739)
  {2001, 90, 21, 2}
  iex>Elixir.Icelandic.as_date({2001, 90, 21, 2})
  {2001, 90, 21, 2}

Specs

as_fixed(fixed() | icelandic_date()) :: fixed()

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

This is a convenience function to simplify certain function calls.

Examples

  iex>Elixir.Icelandic.as_fixed(730739)
  730739
  iex>Elixir.Icelandic.as_fixed({2001, 90, 21, 2})
  730739
Link to this function

as_type(cal_date, type \\ :fixed)

View Source

Specs

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

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

The type parameter determines the type of the returned value:

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

Examples

  iex>Elixir.Icelandic.as_type(730739)
  730739
  iex>Elixir.Icelandic.as_type(730739, :fixed)
  730739
  iex>Elixir.Icelandic.as_type(730739, :date)
  {2001, 90, 21, 2}
  iex>Elixir.Icelandic.as_type({2001, 90, 21, 2})
  730739
  iex>Elixir.Icelandic.as_type({2001, 90, 21, 2}, :fixed)
  730739
  iex>Elixir.Icelandic.as_type({2001, 90, 21, 2}, :date)
  {2001, 90, 21, 2}

Specs

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

Compares two Icelandic 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.Icelandic.compare({2001, 90, 21, 2}, {2001, 90, 21, 2})
  :eq
  iex>Elixir.Icelandic.compare({2001, 90, 21, 2}, {2001, 270, 8, 4})
  :lt
  iex>Elixir.Icelandic.compare({2001, 270, 8, 4}, {2001, 90, 21, 2})
  :gt
Link to this function

date(year, season, week, weekday)

View Source

Specs

Returns a Icelandic date from its fields year, season, week, weekday.

Example

  iex>Elixir.Icelandic.date(2001, 90, 21, 2)
  {2001, 90, 21, 2}
Link to this function

date_diff(cal_date1, cal_date2)

View Source

Specs

date_diff(fixed() | icelandic_date(), fixed() | icelandic_date()) :: integer()

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

The dates can be given as fixed days or Icelandic 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.Icelandic.date_diff(730739, 730839)
  100
  iex>Elixir.Icelandic.date_diff(730839, 730739)
  -100
  iex>Elixir.Icelandic.date_diff({2001, 90, 21, 2}, {2001, 270, 8, 4})
  100
  iex>Elixir.Icelandic.date_diff({2001, 270, 8, 4}, {2001, 90, 21, 2})
  -100
  iex>Elixir.Icelandic.date_diff(730739, {2001, 270, 8, 4})
  100
  iex>Elixir.Icelandic.date_diff({2001, 90, 21, 2}, 730839)
  100
Link to this function

desember(type \\ :integer)

View Source

Specs

desember(:integer | :name) :: integer()

Returns the month desember of the Icelandic calendar.

The type parameter determines the type of the returned month:

  • :integer returns the number of the month (default),
  • :name returns the name of the month.

Examples

  iex>Elixir.Icelandic.desember()
  12
  iex>Elixir.Icelandic.desember(:integer)
  12
  iex>Elixir.Icelandic.desember(:name)
  "Desember"

Specs

epoch() :: number()

Returns the epoch of the Icelandic calendar.

Example

  iex>Elixir.Icelandic.epoch()
  109

Specs

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

Examples

  iex>Elixir.Icelandic.eq({2001, 90, 21, 2}, {2001, 90, 21, 2})
  true
  iex>Elixir.Icelandic.eq({2001, 90, 21, 2}, {2001, 270, 8, 4})
  false
  iex>Elixir.Icelandic.eq({2001, 270, 8, 4}, {2001, 90, 21, 2})
  false
Link to this function

februar(type \\ :integer)

View Source

Specs

februar(:integer | :name) :: integer()

Returns the month februar of the Icelandic calendar.

The type parameter determines the type of the returned month:

  • :integer returns the number of the month (default),
  • :name returns the name of the month.

Examples

  iex>Elixir.Icelandic.februar()
  2
  iex>Elixir.Icelandic.februar(:integer)
  2
  iex>Elixir.Icelandic.februar(:name)
  "Febrúar"

Specs

field_atom(integer()) :: atom()

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

Examples

  iex>Elixir.Icelandic.field_atom(0)
  :year
  iex>Elixir.Icelandic.field_atom(1)
  :season
  iex>Elixir.Icelandic.field_atom(2)
  :week
  iex>Elixir.Icelandic.field_atom(3)
  :weekday

Specs

field_atoms() :: [atom()]

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

Example

  iex>Elixir.Icelandic.field_atoms()
  [:year, :season, :week, :weekday]

Specs

field_count() :: integer()

Returns the number of fields in a Icelandic date

Example

  iex>Elixir.Icelandic.field_count()
  4

Specs

field_index(atom()) :: integer()

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

Examples

  iex>Elixir.Icelandic.field_index(:year)
  0
  iex>Elixir.Icelandic.field_index(:season)
  1
  iex>Elixir.Icelandic.field_index(:week)
  2
  iex>Elixir.Icelandic.field_index(:weekday)
  3
Link to this function

friday(type \\ :integer)

View Source

Specs

friday(:integer | :name) :: integer()

Returns the weekday friday of the Icelandic calendar.

The type parameter determines the type of the returned weekday:

  • :integer returns the number of the weekday (default),
  • :name returns the name of the weekday.

Examples

  iex>Elixir.Icelandic.friday()
  5
  iex>Elixir.Icelandic.friday(:integer)
  5
  iex>Elixir.Icelandic.friday(:name)
  "Föstudagur"
Link to this function

from_date(other_date, other_calendar)

View Source

Specs

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

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

Example

  iex>Elixir.Icelandic.from_date({2001, 9, 11}, Gregorian)
  {2001, 90, 21, 2}

Specs

from_fixed(fixed()) :: icelandic_date()

Converts a fixed day to a Icelandic date.

Example

  iex>Elixir.Icelandic.from_fixed(730739)
  {2001, 90, 21, 2}

Specs

from_jd(tuple() | number()) :: icelandic_date()

Converts a Julian Day into the equivalent Icelandic date.

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

Examples

  iex>Elixir.Icelandic.from_jd({2452163.5})
  {2001, 90, 21, 2}
  iex>Elixir.Icelandic.from_jd(2452163.5)
  {2001, 90, 21, 2}

Specs

from_rata_die(tuple() | integer()) :: icelandic_date()

Converts a RataDie date into the equivalent Icelandic date.

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

Examples

  iex>Elixir.Icelandic.from_rata_die({730739})
  {2001, 90, 21, 2}
  iex>Elixir.Icelandic.from_rata_die(730739)
  {2001, 90, 21, 2}

Specs

from_unix(tuple() | integer()) :: icelandic_date()

Converts a Unix date into the equivalent Icelandic date.

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

Examples

  iex>Elixir.Icelandic.from_unix({1000166400})
  {2001, 90, 21, 2}
  iex>Elixir.Icelandic.from_unix(1000166400)
  {2001, 90, 21, 2}

Specs

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

Examples

  iex>Elixir.Icelandic.ge({2001, 90, 21, 2}, {2001, 90, 21, 2})
  true
  iex>Elixir.Icelandic.ge({2001, 90, 21, 2}, {2001, 270, 8, 4})
  false
  iex>Elixir.Icelandic.ge({2001, 270, 8, 4}, {2001, 90, 21, 2})
  true

Specs

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

Examples

  iex>Elixir.Icelandic.gt({2001, 90, 21, 2}, {2001, 90, 21, 2})
  false
  iex>Elixir.Icelandic.gt({2001, 90, 21, 2}, {2001, 270, 8, 4})
  false
  iex>Elixir.Icelandic.gt({2001, 270, 8, 4}, {2001, 90, 21, 2})
  true
Link to this function

icelandic_summer(icelandic_year)

View Source

Specs

icelandic_summer(icelandic_year()) :: fixed()

Returns the start of summer in the given icelandic_year.

Example

iex>Elixir.Icelandic.icelandic_summer(2001)
730594
Link to this function

icelandic_winter(icelandic_year)

View Source

Specs

icelandic_winter(icelandic_year()) :: fixed()

Returns the start of winter in the given icelandic_year.

Example

iex>Elixir.Icelandic.icelandic_winter(2001)
730785
Link to this function

januar(type \\ :integer)

View Source

Specs

januar(:integer | :name) :: integer()

Returns the month januar of the Icelandic calendar.

The type parameter determines the type of the returned month:

  • :integer returns the number of the month (default),
  • :name returns the name of the month.

Examples

  iex>Elixir.Icelandic.januar()
  1
  iex>Elixir.Icelandic.januar(:integer)
  1
  iex>Elixir.Icelandic.januar(:name)
  "Janúar"

Specs

juli(:integer | :name) :: integer()

Returns the month juli of the Icelandic calendar.

The type parameter determines the type of the returned month:

  • :integer returns the number of the month (default),
  • :name returns the name of the month.

Examples

  iex>Elixir.Icelandic.juli()
  7
  iex>Elixir.Icelandic.juli(:integer)
  7
  iex>Elixir.Icelandic.juli(:name)
  "Júlí"

Specs

juni(:integer | :name) :: integer()

Returns the month juni of the Icelandic calendar.

The type parameter determines the type of the returned month:

  • :integer returns the number of the month (default),
  • :name returns the name of the month.

Examples

  iex>Elixir.Icelandic.juni()
  6
  iex>Elixir.Icelandic.juni(:integer)
  6
  iex>Elixir.Icelandic.juni(:name)
  "Júní"

Specs

keyword() :: atom()

Returns the internal keyword of the Icelandic calendar.

Example

  iex>Elixir.Icelandic.keyword()
  :icelandic

Specs

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

Examples

  iex>Elixir.Icelandic.le({2001, 90, 21, 2}, {2001, 90, 21, 2})
  true
  iex>Elixir.Icelandic.le({2001, 90, 21, 2}, {2001, 270, 8, 4})
  true
  iex>Elixir.Icelandic.le({2001, 270, 8, 4}, {2001, 90, 21, 2})
  false

Specs

leap_year?(icelandic_year()) :: boolean()

Returns true if the Icelandic year is a leap year, otherwise false.

Examples

  iex>Elixir.Icelandic.leap_year?(2000)
  false
  iex>Elixir.Icelandic.leap_year?(2001)
  true
  iex>Elixir.Icelandic.leap_year?(2002)
  false
  iex>Elixir.Icelandic.leap_year?(2003)
  false

Specs

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

Examples

  iex>Elixir.Icelandic.lt({2001, 90, 21, 2}, {2001, 90, 21, 2})
  false
  iex>Elixir.Icelandic.lt({2001, 90, 21, 2}, {2001, 270, 8, 4})
  true
  iex>Elixir.Icelandic.lt({2001, 270, 8, 4}, {2001, 90, 21, 2})
  false

Specs

mai(:integer | :name) :: integer()

Returns the month mai of the Icelandic calendar.

The type parameter determines the type of the returned month:

  • :integer returns the number of the month (default),
  • :name returns the name of the month.

Examples

  iex>Elixir.Icelandic.mai()
  5
  iex>Elixir.Icelandic.mai(:integer)
  5
  iex>Elixir.Icelandic.mai(:name)
  "Maí"

Specs

mar(:integer | :name) :: integer()

Returns the month mar of the Icelandic calendar.

The type parameter determines the type of the returned month:

  • :integer returns the number of the month (default),
  • :name returns the name of the month.

Examples

  iex>Elixir.Icelandic.mar()
  3
  iex>Elixir.Icelandic.mar(:integer)
  3
  iex>Elixir.Icelandic.mar(:name)
  "Mars"

Specs

module() :: module()

Returns the module of the Icelandic calendar.

Example

  iex>Elixir.Icelandic.module()
  Icelandic
Link to this function

monday(type \\ :integer)

View Source

Specs

monday(:integer | :name) :: integer()

Returns the weekday monday of the Icelandic calendar.

The type parameter determines the type of the returned weekday:

  • :integer returns the number of the weekday (default),
  • :name returns the name of the weekday.

Examples

  iex>Elixir.Icelandic.monday()
  1
  iex>Elixir.Icelandic.monday(:integer)
  1
  iex>Elixir.Icelandic.monday(:name)
  "Mánudagur"

Specs

month(icelandic_date()) :: integer()

Returns the month of the given icelandic_date.

Example

iex>Elixir.Icelandic.month({2001, 90, 21, 2})
5

Specs

months(:atom | :integer | :name) :: [integer() | atom() | String.t()]

Returns a list of the months of the Icelandic calendar.

The type parameter determines the type of the returned months:

  • :integer returns the numbers of the months,
  • :atom returns the internal names of the months,
  • :name returns the common names of the months (default).

Examples

  iex>Elixir.Icelandic.months()
  ["Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "Nóvember", "Desember"]
  iex>Elixir.Icelandic.months(:integer)
  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
  iex>Elixir.Icelandic.months(:atom)
  [:januar, :februar, :mar, :april, :mai, :juni, :juli, :agust, :september, :oktober, :november, :desember]
  iex>Elixir.Icelandic.months(:name)
  ["Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "Nóvember", "Desember"]

Specs

name() :: atom()

Returns the internal name of the Icelandic calendar.

Example

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

november(type \\ :integer)

View Source

Specs

november(:integer | :name) :: integer()

Returns the month november of the Icelandic calendar.

The type parameter determines the type of the returned month:

  • :integer returns the number of the month (default),
  • :name returns the name of the month.

Examples

  iex>Elixir.Icelandic.november()
  11
  iex>Elixir.Icelandic.november(:integer)
  11
  iex>Elixir.Icelandic.november(:name)
  "Nóvember"
Link to this function

oktober(type \\ :integer)

View Source

Specs

oktober(:integer | :name) :: integer()

Returns the month oktober of the Icelandic calendar.

The type parameter determines the type of the returned month:

  • :integer returns the number of the month (default),
  • :name returns the name of the month.

Examples

  iex>Elixir.Icelandic.oktober()
  10
  iex>Elixir.Icelandic.oktober(:integer)
  10
  iex>Elixir.Icelandic.oktober(:name)
  "Október"

Specs

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

Example

  iex>Elixir.Icelandic.range({2001, 90, 21, 2}, {2001, 270, 8, 4})
  730739..730839
Link to this function

saturday(type \\ :integer)

View Source

Specs

saturday(:integer | :name) :: integer()

Returns the weekday saturday of the Icelandic calendar.

The type parameter determines the type of the returned weekday:

  • :integer returns the number of the weekday (default),
  • :name returns the name of the weekday.

Examples

  iex>Elixir.Icelandic.saturday()
  6
  iex>Elixir.Icelandic.saturday(:integer)
  6
  iex>Elixir.Icelandic.saturday(:name)
  "Laugardagur"
Link to this function

season(cal_date, type \\ :value)

View Source

Specs

season(fixed() | icelandic_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the season field of a Icelandic date.

The type parameter determines the type of the returned season:

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

Examples

  iex>Elixir.Icelandic.season(730739)
  90
  iex>Elixir.Icelandic.season(730739, :atom)
  :season
  iex>Elixir.Icelandic.season(730739, :index)
  1
  iex>Elixir.Icelandic.season(730739, :name)
  "Season"
  iex>Elixir.Icelandic.season(730739, :value)
  90

  iex>Elixir.Icelandic.season({2001, 90, 21, 2})
  90
  iex>Elixir.Icelandic.season({2001, 90, 21, 2}, :atom)
  :season
  iex>Elixir.Icelandic.season({2001, 90, 21, 2}, :index)
  1
  iex>Elixir.Icelandic.season({2001, 90, 21, 2}, :name)
  "Season"
  iex>Elixir.Icelandic.season({2001, 90, 21, 2}, :value)
  90
Link to this function

september(type \\ :integer)

View Source

Specs

september(:integer | :name) :: integer()

Returns the month september of the Icelandic calendar.

The type parameter determines the type of the returned month:

  • :integer returns the number of the month (default),
  • :name returns the name of the month.

Examples

  iex>Elixir.Icelandic.september()
  9
  iex>Elixir.Icelandic.september(:integer)
  9
  iex>Elixir.Icelandic.september(:name)
  "September"

Specs

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

Returns the start of the day in the Icelandic calendar.

Possible return values are:

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

Example

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

sunday(type \\ :integer)

View Source

Specs

sunday(:integer | :name) :: integer()

Returns the weekday sunday of the Icelandic calendar.

The type parameter determines the type of the returned weekday:

  • :integer returns the number of the weekday (default),
  • :name returns the name of the weekday.

Examples

  iex>Elixir.Icelandic.sunday()
  7
  iex>Elixir.Icelandic.sunday(:integer)
  7
  iex>Elixir.Icelandic.sunday(:name)
  "Sunnudagur"
Link to this function

thursady(type \\ :integer)

View Source

Specs

thursady(:integer | :name) :: integer()

Returns the weekday thursady of the Icelandic calendar.

The type parameter determines the type of the returned weekday:

  • :integer returns the number of the weekday (default),
  • :name returns the name of the weekday.

Examples

  iex>Elixir.Icelandic.thursady()
  4
  iex>Elixir.Icelandic.thursady(:integer)
  4
  iex>Elixir.Icelandic.thursady(:name)
  "Fimmtudagur"
Link to this function

to_date(date, other_calendar)

View Source

Specs

to_date(icelandic_date(), module()) :: tuple()

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

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

Example

  iex>Elixir.Icelandic.to_date({2001, 90, 21, 2}, Gregorian)
  {2001, 9, 11}

Specs

to_fixed(icelandic_date()) :: fixed()

Converts a Icelandic date tuple into a fixed day.

Example

  iex>Elixir.Icelandic.to_fixed({2001, 90, 21, 2})
  730739
Link to this function

to_fixed(year, season, week, weekday)

View Source

Specs

Converts a Icelandic date given by year, season, week, weekday into a fixed day.

Example

  iex>Elixir.Icelandic.to_fixed(2001, 90, 21, 2)
  730739

Specs

to_jd(icelandic_date()) :: {number()}

Converts a Icelandic date into the equivalent Julian Day.

Example

  iex>Elixir.Icelandic.to_jd({2001, 90, 21, 2})
  {2452163.5}
Link to this function

to_jd(year, season, week, weekday)

View Source

Specs

Converts a Icelandic date given by year, season, week, weekday into the equivalent Julian Day.

Example

  iex>Elixir.Icelandic.to_jd(2001, 90, 21, 2)
  {2452163.5}

Specs

to_rata_die(icelandic_date()) :: {integer()}

Converts a Icelandic date into the equivalent RataDie date.

Example

  iex>Elixir.Icelandic.to_rata_die({2001, 90, 21, 2})
  {730739}
Link to this function

to_rata_die(year, season, week, weekday)

View Source

Specs

Converts a Icelandic date given by year, season, week, weekday into the equivalent RataDie date.

Example

  iex>Elixir.Icelandic.to_rata_die(2001, 90, 21, 2)
  {730739}

Specs

to_unix(icelandic_date()) :: {integer()}

Converts a Icelandic date into the equivalent Unix date.

Example

  iex>Elixir.Icelandic.to_unix({2001, 90, 21, 2})
  {1000166400}
Link to this function

to_unix(year, season, week, weekday)

View Source

Specs

Converts a Icelandic date given by year, season, week, weekday into the equivalent Unix date.

Example

  iex>Elixir.Icelandic.to_unix(2001, 90, 21, 2)
  {1000166400}

Specs

today(:fixed | :date) :: fixed() | icelandic_date()

Returns the current date either as a fixed day or a Icelandic 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 Icelandic date.

Examples

  Elixir.Icelandic.today()
  730739
  Elixir.Icelandic.today(:fixed)
  730739
  Elixir.Icelandic.today(:date)
  {2001, 90, 21, 2}
Link to this function

tuesday(type \\ :integer)

View Source

Specs

tuesday(:integer | :name) :: integer()

Returns the weekday tuesday of the Icelandic calendar.

The type parameter determines the type of the returned weekday:

  • :integer returns the number of the weekday (default),
  • :name returns the name of the weekday.

Examples

  iex>Elixir.Icelandic.tuesday()
  2
  iex>Elixir.Icelandic.tuesday(:integer)
  2
  iex>Elixir.Icelandic.tuesday(:name)
  "Þriðjudagur"
Link to this function

wednesday(type \\ :integer)

View Source

Specs

wednesday(:integer | :name) :: integer()

Returns the weekday wednesday of the Icelandic calendar.

The type parameter determines the type of the returned weekday:

  • :integer returns the number of the weekday (default),
  • :name returns the name of the weekday.

Examples

  iex>Elixir.Icelandic.wednesday()
  3
  iex>Elixir.Icelandic.wednesday(:integer)
  3
  iex>Elixir.Icelandic.wednesday(:name)
  "Miðvikudagur"
Link to this function

week(cal_date, type \\ :value)

View Source

Specs

week(fixed() | icelandic_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the week field of a Icelandic date.

The type parameter determines the type of the returned week:

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

Examples

  iex>Elixir.Icelandic.week(730739)
  21
  iex>Elixir.Icelandic.week(730739, :atom)
  :week
  iex>Elixir.Icelandic.week(730739, :index)
  2
  iex>Elixir.Icelandic.week(730739, :name)
  "Week"
  iex>Elixir.Icelandic.week(730739, :value)
  21

  iex>Elixir.Icelandic.week({2001, 90, 21, 2})
  21
  iex>Elixir.Icelandic.week({2001, 90, 21, 2}, :atom)
  :week
  iex>Elixir.Icelandic.week({2001, 90, 21, 2}, :index)
  2
  iex>Elixir.Icelandic.week({2001, 90, 21, 2}, :name)
  "Week"
  iex>Elixir.Icelandic.week({2001, 90, 21, 2}, :value)
  21
Link to this function

weekday(cal_date, type \\ :value)

View Source

Specs

weekday(fixed() | icelandic_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the weekday field of a Icelandic date.

The type parameter determines the type of the returned weekday:

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

Examples

  iex>Elixir.Icelandic.weekday(730739)
  2
  iex>Elixir.Icelandic.weekday(730739, :atom)
  :weekday
  iex>Elixir.Icelandic.weekday(730739, :index)
  3
  iex>Elixir.Icelandic.weekday(730739, :name)
  "Weekday"
  iex>Elixir.Icelandic.weekday(730739, :value)
  2

  iex>Elixir.Icelandic.weekday({2001, 90, 21, 2})
  2
  iex>Elixir.Icelandic.weekday({2001, 90, 21, 2}, :atom)
  :weekday
  iex>Elixir.Icelandic.weekday({2001, 90, 21, 2}, :index)
  3
  iex>Elixir.Icelandic.weekday({2001, 90, 21, 2}, :name)
  "Weekday"
  iex>Elixir.Icelandic.weekday({2001, 90, 21, 2}, :value)
  2

Returns a list of the weekdays of the Icelandic calendar.

The type parameter determines the type of the returned weekdays:

  • :integer returns the numbers of the weekdays,
  • :atom returns the internal names of the weekdays,
  • :name returns the common names of the weekdays (default).

Examples

  iex>Elixir.Icelandic.weekdays()
  ["Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur", "Sunnudagur"]
  iex>Elixir.Icelandic.weekdays(:integer)
  [1, 2, 3, 4, 5, 6, 7]
  iex>Elixir.Icelandic.weekdays(:atom)
  [:monday, :tuesday, :wednesday, :thursady, :friday, :saturday, :sunday]
  iex>Elixir.Icelandic.weekdays(:name)
  ["Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur", "Sunnudagur"]
Link to this function

year(cal_date, type \\ :value)

View Source

Specs

year(fixed() | icelandic_date(), :atom | :index | :name | :value) ::
  :atom | integer() | String.t() | number()

Returns the year field of a Icelandic date.

The type parameter determines the type of the returned year:

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

Examples

  iex>Elixir.Icelandic.year(730739)
  2001
  iex>Elixir.Icelandic.year(730739, :atom)
  :year
  iex>Elixir.Icelandic.year(730739, :index)
  0
  iex>Elixir.Icelandic.year(730739, :name)
  "Year"
  iex>Elixir.Icelandic.year(730739, :value)
  2001

  iex>Elixir.Icelandic.year({2001, 90, 21, 2})
  2001
  iex>Elixir.Icelandic.year({2001, 90, 21, 2}, :atom)
  :year
  iex>Elixir.Icelandic.year({2001, 90, 21, 2}, :index)
  0
  iex>Elixir.Icelandic.year({2001, 90, 21, 2}, :name)
  "Year"
  iex>Elixir.Icelandic.year({2001, 90, 21, 2}, :value)
  2001