getNextMonth

Commons
stable

Returns a new Date set to the first day of the month that follows the given date, without mutating the input.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

date
required
Date
The reference date. Its year and month are used to compute the following month; the input is not mutated.

API

Return value

The value returned by this util.

A new Date object pointing to the 1st of the next month at midnight local time.

Usage

Examples

Ready-to-paste usage snippets.

Navigate to the next calendar month

typescript