endOfWeek

Modified on Thu, 24 Aug 2023

Description

Use this function to obtain the end of a week for the given date. The result will be in the local timezone.

Syntax

endOfWeek(date)

Returns

Return ValueDescription
DateReturns a Date object representing the end of the week for the given date in the local timezone.

Sample

ExampleResultDescription
endOfWeek(2023-04-03)2023-04-08Returns the end of the week for April 3, 2023, in the local timezone. Since April 3, 2023, is a Monday, the end of the week is Saturday, April 8, 2023.

To view all the Date functions, click here.

See Also