TimeUtils.GetLastDayOfWeek method

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Time
Assembly Skybrud.Essentials.dll

GetLastDayOfWeek(DateTime)

Static

Gets the last day of the week of the specified date. Monday is considered the first day of the week.

public static DateTime GetLastDayOfWeek(DateTime date)

Parameters

date DateTime

The date.

Returns

An instance of DateTime representing the last day of the week.

GetLastDayOfWeek(DateTimeOffset)

Static

Gets the last day of the week of the specified date. Monday is considered the first day of the week.

public static DateTimeOffset GetLastDayOfWeek(DateTimeOffset date)

Parameters

The date.

Returns

An instance of DateTimeOffset representing the last day of the week.

GetLastDayOfWeek(DateTime, DayOfWeek)

Static

Gets the last day of the week of the specified date and based on startOfWeek.

public static DateTime GetLastDayOfWeek(DateTime date, DayOfWeek startOfWeek)

Parameters

date DateTime

The date.

startOfWeek DayOfWeek

The first day of the week (eg. System.DayOfWeek.Monday or System.DayOfWeek.Sunday).

Returns

An instance of DateTime representing the last day of the week.

GetLastDayOfWeek(DateTimeOffset, DayOfWeek)

Static

Gets the last day of the week of the specified date and based on startOfWeek.

public static DateTimeOffset GetLastDayOfWeek(DateTimeOffset date, DayOfWeek startOfWeek)

Parameters

The date.

startOfWeek DayOfWeek

The first day of the week (eg. System.DayOfWeek.Monday or System.DayOfWeek.Sunday).

Returns

An instance of DateTimeOffset representing the last day of the week.