Skip to content

getFirstDayOfWeek

The getFirstDayOfWeek() function returns the Monday corresponding to the week of the provided TheDate or SerializedTheDate.

Interactive example

Syntax

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

Parameters

  • input: TheDate or SerializedTheDate.

Return value

A TheDate representing Monday of the same week, normalized to 00:00:00.000 UTC.

See also

Sources

Released under the MIT license.