Date.StartOfWeek
Date.StartOfWeek(dateTime as any, optional firstDayOfWeek as nullable number) as any
Returnerer starten af ugen, der indeholder dateTime
.
dateTime
skal være en værdi af typen date
, datetime
eller datetimezone
.
Find ugens start for tirsdag den 11. oktober 2011.
brug
Date.StartOfWeek(#datetime(2011, 10, 11, 8, 10, 32))
output
// Sunday, October 9th, 2011
#datetime(2011, 10, 9, 0, 0, 0)
Find ugens start for tirsdag den 11. oktober 2011 med mandag som ugens start.
brug
Date.StartOfWeek(#datetime(2011, 10, 11, 8, 10, 32), Day.Monday)
output
// Monday, October 10th, 2011
#datetime(2011, 10, 10, 0, 0, 0)