DateTimeExtensions..::..LastDayOfWeek Method

Retrieves the last day of the week that occurred since date.

Namespace:  Core
Assembly:  Core (in Core.dll)

Syntax


public static DateTime LastDayOfWeek(
	DateTime date,
	DayOfWeek dayOfweek
)

Parameters

date
Type: DateTime
A date.
dayOfweek
Type: DayOfWeek
The kind of DayOfWeek we want to get.

Return Value

A DateTime representing the last day of the week that occourred.

Remarks


If date.DayOfWeek is already dayOfweek, it will return the last one (seven days before)