Discordian.Calendar (discordian v0.1.0) View Source

Link to this section Summary

Functions

Converts the date into a string according to the calendar.

Converts the datetime (with time zone) into a string according to the calendar.

Calculates the day and era from the given year, month, and day.

Calculates the day of the week from the given year, month, and day.

Calculates the day of the year from the given year, month, and day.

Define the rollover moment for the given calendar.

Returns how many days there are in the given year-month.

Returns true if the given year is a leap year.

Returns how many months there are in the given year.

Converts iso_days/0 to the Calendar's datetime format.

Converts the given datetime (without time zone) into the iso_days/0 format.

Converts the datetime (without time zone) into a string according to the calendar.

Parses the string representation for a date returned by date_to_string/3 into a date-tuple.

Parses the string representation for a naive datetime returned by naive_datetime_to_string/7 into a naive-datetime-tuple.

Parses the string representation for a time returned by time_to_string/4 into a time-tuple.

Parses the string representation for a datetime returned by datetime_to_string/11 into a datetime-tuple.

Calculates the quarter of the year from the given year, month, and day.

Converts day_fraction/0 to the Calendar's time format.

Converts the given time to the day_fraction/0 format.

Converts the time into a string according to the calendar.

Should return true if the given date describes a proper date in the calendar.

Should return true if the given time describes a proper time in the calendar.

Calculates the year and era from the given year.

Link to this section Types

Specs

day() :: 1..73

Specs

day_of_week() :: 1..5

Specs

hour() :: 0..23

Specs

microsecond() :: Integer.t()

Specs

minute() :: 0..59

Specs

month() :: 1..6

Specs

second() :: 0..60

Specs

year() :: Integer.t()

Link to this section Functions

Link to this function

date_to_string(year, month, day)

View Source

Specs

date_to_string(year(), month(), day()) :: String.t()

Converts the date into a string according to the calendar.

Link to this function

datetime_to_string(year, month, day, hour, minute, second, microsecond, time_zone, zone_abbr, utc_offset, std_offset)

View Source

Converts the datetime (with time zone) into a string according to the calendar.

Link to this function

day_of_era(year, month, day)

View Source

Specs

day_of_era(year(), month(), day()) :: {day :: pos_integer(), era :: 0..1}

Calculates the day and era from the given year, month, and day.

Link to this function

day_of_week(year, month, day)

View Source

Specs

day_of_week(year(), month(), day()) :: day_of_week()

Calculates the day of the week from the given year, month, and day.

Link to this function

day_of_year(year, month, day)

View Source

Specs

day_of_year(year(), month(), day()) :: 1..366

Calculates the day of the year from the given year, month, and day.

Link to this function

day_rollover_relative_to_midnight_utc()

View Source

Define the rollover moment for the given calendar.

Link to this function

days_in_month(year, month)

View Source

Specs

days_in_month(Calendar.year(), Calendar.month()) :: Calendar.day()

Returns how many days there are in the given year-month.

Specs

leap_year?(Calendar.year()) :: boolean()

Returns true if the given year is a leap year.

Specs

months_in_year(year()) :: 5

Returns how many months there are in the given year.

Link to this function

naive_datetime_from_iso_days(arg)

View Source

Specs

Converts iso_days/0 to the Calendar's datetime format.

Link to this function

naive_datetime_to_iso_days(year, month, day, hour, minute, second, microsecond)

View Source

Specs

Converts the given datetime (without time zone) into the iso_days/0 format.

Link to this function

naive_datetime_to_string(year, month, day, hour, minute, second, microsecond)

View Source

Specs

naive_datetime_to_string(
  year(),
  month(),
  day(),
  hour(),
  minute(),
  second(),
  microsecond()
) :: String.t()

Converts the datetime (without time zone) into a string according to the calendar.

Parses the string representation for a date returned by date_to_string/3 into a date-tuple.

Link to this function

parse_naive_datetime(string_date)

View Source

Parses the string representation for a naive datetime returned by naive_datetime_to_string/7 into a naive-datetime-tuple.

Parses the string representation for a time returned by time_to_string/4 into a time-tuple.

Link to this function

parse_utc_datetime(string_date)

View Source

Parses the string representation for a datetime returned by datetime_to_string/11 into a datetime-tuple.

Link to this function

quarter_of_year(year, month, day)

View Source

Specs

quarter_of_year(year(), month(), day()) :: 1..4

Calculates the quarter of the year from the given year, month, and day.

Link to this function

time_from_day_fraction(arg)

View Source

Specs

Converts day_fraction/0 to the Calendar's time format.

Link to this function

time_to_day_fraction(hour, minute, second, arg)

View Source

Specs

Converts the given time to the day_fraction/0 format.

Link to this function

time_to_string(hour, minute, second, microsecond)

View Source

Converts the time into a string according to the calendar.

Link to this function

valid_date?(year, month, day)

View Source

Should return true if the given date describes a proper date in the calendar.

Link to this function

valid_time?(hour, minute, second, arg)

View Source

Should return true if the given time describes a proper time in the calendar.

Specs

year_of_era(year()) :: {year(), era :: 0..1}

Calculates the year and era from the given year.