UNPKG

@qntm-code/utils

Version:

A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.

16 lines (15 loc) 458 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setEndOfMonth = void 0; const index_js_1 = require("./index.js"); /** * Takes a given date and mutates it to the end of the given month */ function setEndOfMonth(date) { (0, index_js_1.setStartOfMonth)(date); (0, index_js_1.setEndOfDay)(date); date.setMonth(date.getMonth() + 1); date.setDate(0); return date; } exports.setEndOfMonth = setEndOfMonth;