addYears
The addYears() function adds a positive 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,
GenericYear extends number
>(
input: GenericInput,
year: PositiveNumber<GenericYear>
): TheDateCurried signature
typescript
function addYears<
GenericInput extends TheDate,
GenericYear extends number
>(
year: PositiveNumber<GenericYear>
): (input: GenericInput) => TheDateParameters
year: Strictly positive number of years (PositiveNumber).input:TheDateto modify (classic version).
Return value
A new TheDate incremented by the requested number of years.
