addYears()function

addYears(change: number, target?: PossibleDate, caller: AnyCaller = addYears): Date
ParamType
changenumber
required
targetPossibleDate
Values that can be converted to dates.
callerAnyCaller
Any calling function or constructor, usually referring to something that can call in the current scope that can appear in a stack trace. Defaults to addYears
Return
Date

Return a new date that increase or decreases the month based on an input date.

  • February 29th is a special cased and is rounded down to February 28th on non-leap years.