addYears
The addYears() function adds a number of years to a TheDate. It accepts a curried signature to compose transformations.
Interactive example
Syntax
Classic signature
typescript
function addYears<
GenericInput extends TheDate | SerializedTheDate,
GenericYear extends number
>(
input: GenericInput,
year: GenericYear
): TheDateCurried signature
typescript
function addYears<
GenericInput extends TheDate | SerializedTheDate,
GenericYear extends number
>(
year: GenericYear
): (input: GenericInput) => TheDateParameters
year: Number of years.input:TheDateorSerializedTheDate.
Return value
A new TheDate incremented by the requested number of years.
