DateTimeExtensions.GetFirstDayOfWeek method
Version 1.1.28
.NET Framework 4.8
Namespace | Skybrud.Essentials.Time.Extensions |
---|---|
Assembly | Skybrud.Essentials.dll |
GetFirstDayOfWeek(DateTime)
Extension method
Gets the first day of the week of the specified date
. Monday is
considered the first day of the week.
public static DateTime GetFirstDayOfWeek(this DateTime date)
GetFirstDayOfWeek(DateTime, DayOfWeek)
Extension method
Gets the first day of the week of the specified date
and based on
startOfWeek
.
public static DateTime GetFirstDayOfWeek(this DateTime date, DayOfWeek startOfWeek)
Parameters
startOfWeek
DayOfWeek
The first day of the week (eg. System.DayOfWeek.Monday
or
System.DayOfWeek.Sunday
).