function copyDate(date, keepTime = true) {
    let newDate = new Date(date.getTime());

    if (typeof keepTime === 'boolean' && !keepTime) {
        resetTime(newDate);
    }

    return newDate;
}
Copies date
@param {Date} date
@param {Boolean} [keepTime] - should keep the time in a new date or not
@return {Date}