UNPKG

@js-sugar/date

Version:

A multi-calendar, tree-shakable, extensible, immutable and lightweight date library for JavaScript

13 lines (12 loc) 440 B
import { DateTime } from '../main'; /** * Gets the start of a month for the given date. * @category Plugins. * @param {DateTime} date - the original date * @returns {DateTime} the start of a month * @example * // The start of a month for 9 December 2021 09:50:01: * const result = endOfMonth(new Date(2021, 12, 9, 09, 50, 1)) * //=> Oct 31 2021 00:00:00 */ export declare function endOfMonth(date: DateTime): DateTime;