Calendrical v0.1.1 Calendrical.Calendar.Julian 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 of the week from the given year, month, and day

Define the rollover moment for the given calendar. This is the moment, in your calendar, when the current day ends and the next day starts. The result of this function is used to check if two calendars rollover at the same time of day. If they do not, we can only convert datetimes and times between them. If they do, this means that we can also convert dates as well as naive datetimes between them. This day fraction should be in its most simplified form possible, to make comparisons fast.

Examples

  • If, in your Calendar, a new day starts at midnight, return {0, 1}.
  • If, in your Calendar, a new day starts at sunrise, return {1, 4}.
  • If, in your Calendar, a new day starts at noon, return {1, 2}.
  • If, in your Calendar, a new day starts at sunset, return {3, 4}

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

Returns true if the given year is a leap year. A leap year is a year of a longer length than normal. The exact meaning is up to the calendar. A calendar must return false if it does not support the concept of leap years

Converts t:rata_die to the Calendar’s datetime format

Converts the given datetime (with time zone) into the t:rata_die format

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

Converts t:day_fraction to the Calendar’s time format

Converts the given time to the t:day_fraction 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

Link to this section Functions

Link to this function date_from_rata_die_days(julian_days) View Source
Link to this function date_to_rata_die_days(year, month, day) View Source
Link to this function date_to_string(year, month, day) View Source

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_week(year, month, day) View Source

Calculates the day of the week 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. This is the moment, in your calendar, when the current day ends and the next day starts. The result of this function is used to check if two calendars rollover at the same time of day. If they do not, we can only convert datetimes and times between them. If they do, this means that we can also convert dates as well as naive datetimes between them. This day fraction should be in its most simplified form possible, to make comparisons fast.

Examples

  • If, in your Calendar, a new day starts at midnight, return {0, 1}.
  • If, in your Calendar, a new day starts at sunrise, return {1, 4}.
  • If, in your Calendar, a new day starts at noon, return {1, 2}.
  • If, in your Calendar, a new day starts at sunset, return {3, 4}.
Link to this function days_in_month(year, month) View Source

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

This is the same as Calendar.ISO except that the leap_year calculation is different.

Returns true if the given year is a leap year. A leap year is a year of a longer length than normal. The exact meaning is up to the calendar. A calendar must return false if it does not support the concept of leap years.

Link to this function naive_datetime_from_rata_die(arg) View Source

Converts t:rata_die to the Calendar’s datetime format.

Link to this function naive_datetime_to_rata_die(year, month, day, hour, minute, second, microsecond) View Source

Converts the given datetime (with time zone) into the t:rata_die format.

Link to this function naive_datetime_to_string(year, month, day, hour, minute, second, microsecond) View Source

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

Link to this function time_from_day_fraction(day_fraction) View Source

Converts t:day_fraction to the Calendar’s time format.

Link to this function time_to_day_fraction(hour, minute, second, microsecond) View Source

Converts the given time to the t:day_fraction 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, microsecond) View Source

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