UNPKG

@sebgroup/frontend-tools

Version:
16 lines (14 loc) 356 B
/** * 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