UNPKG

date-manip

Version:

A lightweight JavaScript date utility library that provides modularity, high performance, and additional features. It supports various date operations, including date addition and subtraction, formatting, comparison, etc.

12 lines (11 loc) 277 B
function startOfDate(date, y, m, d) { return +new Date(y || date.getFullYear(), m == null ? date.getMonth() : m, d || date.getDate()); } function startOfTime(date, ms) { const input = +date; return input - input % ms; } export { startOfTime as a, startOfDate as s };