cloneDate

A function that clones the passed date. The parameter could be null.

cloneDate(new Date(2016, 0, 1)); // returns new Date(2016, 0, 1);
cloneDate(null); // returns null

Parameters

date? Date

The initial date value.

Returns

Date - A new Date instance.

 /