Date.EndOfWeek(dateTime as any, optional firstDayOfWeek as nullable number) as any
Returns the last day of the week in the provided
dateTime. This function takes an optional
firstDayOfWeek, to set the first day of the week for this relative calculation. The default value is
datetimezonevalue from which the last day of the week is calculated
firstDayOfWeek: [Optional] A
Day.Typevalue representing the first day of the week. Possible values are
Day.Saturday.. The default value is
Get the end of the week for 5/14/2011.
Date.EndOfWeek(#date(2011, 5, 14))
#date(2011, 5, 14)
Get the end of the week for 5/17/2011 05:00:00 PM -7:00, with Sunday as the first day of the week.
Date.EndOfWeek(#datetimezone(2011, 5, 17, 5, 0, 0, -7, 0), Day.Sunday)
#datetimezone(2011, 5, 21, 23, 59, 59.9999999, -7, 0)