New to Kendo UI for Angular? Start a free 30-day trial
addYears
A function that adds and subtracts years from a Date
object.
ts
addYears(new Date(2016, 5, 1), 5); // 2011-6-1
addYears(new Date(2016, 5, 1), -5); // 2021-6-1
Parameters
value Date
offset number
The number of years to add or subtract from the date.
Returns
Date - A new Date
instance.