Table of contents
TOC
Collapse the table of content
Expand the table of content

Date.EndOfWeek

Owen Duncan|Last Updated: 10/5/2018
|
1 Contributor

About

Returns a date, datetime, or datetimezone value for the end of the week.

Date.StartOfWeek(dateTime as any, optional firstDayOfWeek as nullable number) as any   

Arguments

ArgumentDescription
dateTimeThe date, datetime, or datetimezone to check against.
optional firstDayOfWeekA number value as an enum value to set the last day of the week. The default value for firstDayOfWeek is Day.Sunday.

Day Enum Values

  • Day.Sunday = 0;

  • Day.Monday = 1;

  • Day.Tuesday = 2;

  • Day.Wednesday = 3;

  • Day.Thursday= 4;

  • Day.Friday = 5;

  • Day.Saturday= 6;

Remarks

  • The date and time portions are reset to their initial values for the week.

  • The timezone information is persisted.

Example

let dateTime = DateTimeZone.FromText("2011-02-24T12:30:00-08:00") in  
Date.EndOfWeek(dateTime, Day.Sunday) equals 2011-02-26T23:59:59.9999999-08:00  
© 2018 Microsoft