Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/complaindate/mod.ts>addMonths

JavaScript date-time utilities that keeps timezones on the surface
Go to Latest
function addMonths
import { addMonths } from "https://deno.land/x/complaindate@v0.7.2/mod.ts";

Get a function curried with a number of months to add to its plain-date arguments.

The resulting day-of-month will always be within the expected month, days will not spill over into the next month.

Parameters

months: number

The number of months to add or subtract

Returns

<T extends ComPlainDate>(date: T) => T

A curried function that operates on plain-dates