addDecades

A function that adds and subtracts decades from a Date object.

addDecades(new Date(2016, 5, 1), 5); // 2066-6-1
addDecades(new Date(2016, 5, 1), -5); // 1966-6-1

Parameters

value Date
offset number

The number of decades to add or subtract from the date.

Returns

Date - A new Date instance.

 /