endOfWeekFixed

Calendar
stable

Returns the last day of the week starting on a given weekday index (0 = Sunday, 1 = Monday …). Symmetric counterpart to startOfWeekFixed. Used by the calendar's week/day views.

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 week.
firstDayOfWeek
required
number
Weekday index for the first day of the week. 0 = Sunday, 1 = Monday, …, 6 = Saturday.

API

Return value

The value returned by this util.

A new Date at midnight on the last day of the week (startOfWeekFixed + 6 days).

Usage

Examples

Ready-to-paste usage snippets.

Week ending on Saturday (Sunday-first)

typescript