addDays

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

addDays(new Date(2016, 0, 1), 5); // 2016-1-6
addDays(new Date(2016, 0, 1), -5); // 2015-12-26

Parameters

date Date

The initial date value.

offset number

The number of days to add and subtract from the date.

Returns

Date - A new Date instance.

 /