UNPKG

everyutil

Version:

A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.

14 lines (13 loc) 382 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.truncateToDay = void 0; /** * Truncates a date to the start of the day. * @author @dailker * @param {Date} date * @returns {Date} */ function truncateToDay(date) { return new Date(date.getFullYear(), date.getMonth(), date.getDate()); } exports.truncateToDay = truncateToDay;