endOfMonth

Commons
stable

Returns a new Date set to the last calendar day of the month containing the given date (midnight, day 0 of next month trick). The input date is not mutated.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

date
requis
Date
Any date within the target month. Only the year and month parts are used.

API

Valeur de retour

La valeur retournée par cet util.

A new Date at midnight on the last day of the same month as the input.

Usage

Exemples

Extraits de code prêts à coller.

Last day of the month

typescript