Skip to content

getFirstDayOfMonth

The getFirstDayOfMonth() function returns the first day of the month (as TheDate) for the provided date input.

Interactive example

Syntax

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

Parameters

  • input: TheDate or SerializedTheDate.

Return value

A TheDate set to the first day of the month (at midnight UTC).

See also

Sources

Released under the MIT license.