endOfYear

Commons
stable

Returns a new Date set to December 31 of the year containing the given date (midnight local time). The input date is not mutated.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

date
required
Date
Any date within the target year. Only the year part is used.

API

Return value

The value returned by this util.

A new Date at midnight on December 31 of the same year as the input.

Usage

Examples

Ready-to-paste usage snippets.

Last day of the year

typescript