endOfWeek
Commons
stable
Returns the last day of the ISO week containing the given date, respecting the locale's first-day-of-week setting. The input date is not mutated.
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.
- localerequiredstring
- BCP 47 locale string (e.g. "en-US", "fr-FR"). The last two characters determine the first day of the week used to derive the last day.
API
Return value
The value returned by this util.
- A new Date set to the last day of the week for the given locale.
Usage
Examples
Ready-to-paste usage snippets.
Last day of the week per locale