Base calendar class, with common calendar functionality.
Converts a short 2-digit year to a full 4-digit year. year will be interpreted to be in range 1930-2029.
Raises chrono.error.YearError if year is invalid.
Converts a date to a julian day number.
Raises chrono.error.YearError, chrono.error.MonthError or chrono.error.DayError if year, month or day is invalid.
Converts a julian day number to a date, returns a tuple of year, month, and day.
Raises chrono.error.DayError if julian is invalid.
Returns True if year is a leap year, otherwise False.
Raises chrono.error.YearError if year is invalid.
Returns the number of days in month. year is needed to handle leap years.
Raises chrono.error.YearError or chrono.error.MonthError if year or month is invalid.
Returns the name of month, according to the current system locale. If short is True, returns the abbreviated month name.
Raises chrono.error.MonthError if month is invalid.
Returns the ordinal day for the given date.
Raises chrono.error.YearError, chrono.error.MonthError or chrono.error.DayError if year, month or day is invalid.
Converts an ordinal day to a date, returned as a tuple of year, month, and day.
Raises chrono.error.YearError or chrono.error.DayError if year or day is invalid.
Validates a date: year must be in range 1-9999, month in range 1-12, and day in range 1-31, depending on year and month.
Raises chrono.error.YearError, chrono.error.MonthError or chrono.error.DayError on invalid input.
Validates month: must be in range 1-12.
Raises chrono.error.MonthError on invalid input.
Validates an ordinal date: year must be in range 1-9999, day must be in range 1-365, or 366 if year is a leap year.
Raises chrono.error.YearError or chrono.error.DayError on invalid input.
Validates a week: year must be in range 1-9999, and week must be in range 1-53, depending on year.
Raises chrono.error.YearError or chrono.error.WeekError if year or week is invalid.
Validates a weekdate: year must be in range 1-9999, week must be in range 1-53, depending on year, and weekday must be in range 1-7.
Raises chrono.error.YearError, chrono.error.WeekError, or chrono.error.DayError if year, week, or weekday is invalid.
Validates a week day: day must be in range 1-7.
Raises chrono.error.DayError if day is invalid.
Validates year: must be in range 1-9999.
Raises chrono.error.YearError if year is invalid.
Returns the week containing the given date as a tuple of year and week.
Raises chrono.error.YearError, chrono.error.MonthError, or chrono.error.DayError if year, month, or day is invalid.
Returns the date of the first day in the given week as a tuple of year, month, and day.
Raises chrono.error.YearError or chrono.error.WeekError if year or week is invalid.
Returns the weekdate for the given date as a tuple with year, week, and weekday.
Raises chrono.error.YearError, chrono.error.MonthError, or chrono.error.DayError if year, month or day is invalid.
Note
This is a placeholder method which just raises NotImplementedError, it is implemented in calendar-specific subclasses.
Returns the date of the given weekdate as a tuple with year, month, and day.
Raises chrono.error.YearError, chrono.error.WeekError, or chrono.error.DayError if year, week or day is invalid.
Note
This is a placeholder method which just raises NotImplementedError, it is implemented in calendar-specific subclasses.
Returns the weekday of the given date.
Raises chrono.error.YearError, chrono.error.MonthError, or chrono.error.DayError if year, month, or day is invalid.
Returns the weekday name of the given weekday. If short is True, returns the abbreviated weekday name.
Raises chrono.error.DayError if weekday is invalid.
Note
This is a placeholder method which just raises NotImplementedError, it is implemented in calendar-specific subclasses.
Returns the number of weeks in year.
Raises chrono.error.YearError if year is invalid.
Note
This is a placeholder method which just raises NotImplementedError, it is implemented in calendar-specific subclasses.
Returns the number of days in year.
Raises chrono.error.YearError if year is invalid.