UNPKG

@js-sugar/date

Version:

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

15 lines (14 loc) 483 B
import { DateTime } from '../main'; /** * @name setMonth * @category plugins * @summary Set the month to the given date. * @description * @param {DateTime} date - the date to be changed * @param {Number} month - the month of the new date [1 to 12] * @returns {DateTime} the new date with the month set * * @example * setMonth(new DateTime(2018,7,31), 2) will be date of 2018-2-28 */ export declare function setMonth(date: DateTime, month: number): DateTime;