Method
AddYears
func AddYears(date: Date, years: int) -> Result<Date, InvalidDateError>
Declaring type: Calendar
Module: System.Time
Assembly: System.Runtime.dll
Source file: Calendar.rvn
Adds calendar years, preserving ordinal month number, clamping month 13 to 12 when absent, then clamping the day. Hebrew month names may change.
Parameters
| Name | Type | Description |
|---|---|---|
date |
Date | Starting day in the selected calendar range. |
years |
Int32 | Signed amount; extreme offsets fail without integer wraparound. |
Return value
Result<Date, InvalidDateError>
Ok(Date), or InvalidDateError when input or result is outside the supported range.