@sebgroup/frontend-tools
Version:
A set of frontend tools
16 lines (14 loc) • 356 B
JavaScript
/**
* Clear the time of a date object
* @param {Date} date The date to clear its time
* @returns {Date} The cleared date object
*/
function clearTime(date) {
if (!(date instanceof Date)) {
date = new Date(date);
}
date.setHours(0, 0, 0, 0);
return date;
}
export { clearTime };
//# sourceMappingURL=clearTime.js.map