Skip to content

getLastDayOfWeek

The getLastDayOfWeek() function returns the Sunday corresponding to the week of the provided TheDate or SerializedTheDate.

Interactive example

Syntax

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

Parameters

  • input: TheDate or SerializedTheDate.

Return value

A TheDate representing Sunday of the same week, normalized to 23:59:59.999 UTC.

See also

Sources

Released under the MIT license.