Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Class

Calendar

class Calendar

Module: System.Time
Assembly: System.Runtime.dll
Source file: Calendar.rvn

Inheritance: Object → Calendar

Immutable calendar selection. Values retain Date's absolute day identity.

Properties

5 items
Static member: Gregorian: Calendar Proleptic Gregorian calendar, years 1–9999.
Static member: Hebrew: Calendar Fixed Hebrew calendar, complete years 5344–5999; civil numbering starts at Tishri.
Id: string Calendar identifier: gregory or hebrew.
MaxYear: int Largest supported complete calendar year.
MinYear: int Smallest supported complete calendar year.

Methods

14 items
AddDays(date: Date, days: int) -> Result<Date, InvalidDateError> Advances absolute days, validating input and result against the calendar range.
AddMonths(date: Date, months: int) -> Result<Date, InvalidDateError> Adds calendar months and clamps the day to the final day of the target month.
AddYears(date: Date, years: int) -> Result<Date, InvalidDateError> Adds calendar years, preserving ordinal month number, clamping month 13 to 12 when absent, then clamping the day. Hebrew month names may change.
CreateDate(year: int, month: int, day: int) -> Result<Date, InvalidDateError> Converts calendar fields to a Date. The returned Date retains Gregorian convenience properties.
Equals(other: object?) -> bool Tests reference identity by default; an ordinary class may override equality. Inherited from Object.Equals
GetDay(date: Date) -> Result<int, InvalidDateError> Projects the calendar one-based day of month from an absolute Date.
GetDaysInMonth(year: int, month: int) -> Result<int, InvalidDateError> Returns the calendar month length, including variable Hebrew Heshvan/Kislev.
GetHashCode() -> int Returns a stable identity hash by default; an ordinary class may override it consistently with equality. Inherited from Object.GetHashCode
GetMonth(date: Date) -> Result<int, InvalidDateError> Projects the calendar one-based civil month from an absolute Date.
GetMonthsInYear(year: int) -> Result<int, InvalidDateError> Returns the count of civil months.
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
GetYear(date: Date) -> Result<int, InvalidDateError> Projects the calendar year from an absolute Date.
IsLeapYear(year: int) -> Result<bool, InvalidDateError> Returns whether this is a leap year.
ToString() -> string Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override. Inherited from Object.ToString