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

API Browser

Method

AddMonths

func AddMonths(date: Date, months: int) -> Result<Date, InvalidDateError>

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

Adds calendar months and clamps the day to the final day of the target month.

Parameters

Name Type Description
date Date Starting day in the selected calendar range.
months 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.