Skip to content

getLastDayOfMonth

The getLastDayOfMonth() function returns the last day of the month corresponding to the provided TheDate or SerializedTheDate.

Interactive example

Syntax

typescript
function getLastDayOfMonth<
	GenericInput extends TheDate | SerializedTheDate
>(
	input: GenericInput
): TheDate

Parameters

  • input: TheDate or SerializedTheDate.

Return value

A TheDate set to the last day of the same month, normalized to 23:59:59.999 UTC.

See also

Sources

Released under the MIT license.