Hop til hovedindhold

Date.StartOfWeek

Returnerer ugens start.

Syntax

Date.StartOfWeek(
dateTime as any,
optional firstDayOfWeek as Day.Type
) as any

Remarks

Returnerer starten af ugen, der indeholder dateTime. dateTime skal være en værdi af typen date, datetime eller datetimezone.

Examples

Example #1

Find ugens start for tirsdag den 11. oktober 2011.

Date.StartOfWeek(#datetime(2011, 10, 11, 8, 10, 32))

Result:

// Sunday, October 9th, 2011
#datetime(2011, 10, 9, 0, 0, 0)

Example #2

Find ugens start for tirsdag den 11. oktober 2011, ved at bruge mandag som ugens start.

Date.StartOfWeek(#datetime(2011, 10, 11, 8, 10, 32), Day.Monday)

Result:

// Monday, October 10th, 2011
#datetime(2011, 10, 10, 0, 0, 0)

Category

Date