Calendrical v0.1.1 Calendrical.Calendar.Gregorian 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
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.
This is the same as Calendar.ISO
except that negative
years are acceptable.
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.