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.
API
Parameters
Input parameters accepted by this util.
- daterequiredDate
- Any date within the target week.
- firstDayOfWeekrequirednumber
- 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)