C# Class BinaryStudio.ClientManager.DomainModel.Infrastructure.DateTimeExtensions

ファイルを表示 Open project: titarenko/ClientManager

Public Methods

Method Description
GetEndOfBusinessWeek ( this dateWithinWeek, int weekendLength = 2, DayOfWeek endOfWeek = DayOfWeek.Sunday ) : System.DateTime

Calculates date of last workday within the week

GetEndOfMonth ( this dayWithinMonth ) : System.DateTime

Calculates date of last day of month

GetEndOfWeek ( this dateWithinWeek, DayOfWeek endOfWeek = DayOfWeek.Sunday ) : System.DateTime

Calculates date of last day of week

GetStartOfBusinessWeek ( this dateWithinWeek, DayOfWeek startOfWeek = DayOfWeek.Monday ) : System.DateTime

Calculates date of the first workday within the week

GetStartOfMonth ( this dayWithinMonth ) : System.DateTime

Calculates date of the first day of month

GetStartOfWeek ( this dateWithinWeek, DayOfWeek startOfWeek = DayOfWeek.Monday ) : System.DateTime

Calculates date of the first day of week

GetWeekNumber ( this dateWithinWeek ) : int

Calculates week number

IsWeekend ( this date, int weekendLength = 2, DayOfWeek endOfWeek = DayOfWeek.Sunday ) : bool

Defines if specified date is weekend

Method Details

GetEndOfBusinessWeek() public static method

Calculates date of last workday within the week
public static GetEndOfBusinessWeek ( this dateWithinWeek, int weekendLength = 2, DayOfWeek endOfWeek = DayOfWeek.Sunday ) : System.DateTime
dateWithinWeek this
weekendLength int
endOfWeek DayOfWeek
return System.DateTime

GetEndOfMonth() public static method

Calculates date of last day of month
public static GetEndOfMonth ( this dayWithinMonth ) : System.DateTime
dayWithinMonth this
return System.DateTime

GetEndOfWeek() public static method

Calculates date of last day of week
public static GetEndOfWeek ( this dateWithinWeek, DayOfWeek endOfWeek = DayOfWeek.Sunday ) : System.DateTime
dateWithinWeek this
endOfWeek DayOfWeek
return System.DateTime

GetStartOfBusinessWeek() public static method

Calculates date of the first workday within the week
public static GetStartOfBusinessWeek ( this dateWithinWeek, DayOfWeek startOfWeek = DayOfWeek.Monday ) : System.DateTime
dateWithinWeek this
startOfWeek DayOfWeek
return System.DateTime

GetStartOfMonth() public static method

Calculates date of the first day of month
public static GetStartOfMonth ( this dayWithinMonth ) : System.DateTime
dayWithinMonth this
return System.DateTime

GetStartOfWeek() public static method

Calculates date of the first day of week
public static GetStartOfWeek ( this dateWithinWeek, DayOfWeek startOfWeek = DayOfWeek.Monday ) : System.DateTime
dateWithinWeek this
startOfWeek DayOfWeek
return System.DateTime

GetWeekNumber() public static method

Calculates week number
public static GetWeekNumber ( this dateWithinWeek ) : int
dateWithinWeek this
return int

IsWeekend() public static method

Defines if specified date is weekend
public static IsWeekend ( this date, int weekendLength = 2, DayOfWeek endOfWeek = DayOfWeek.Sunday ) : bool
date this
weekendLength int
endOfWeek DayOfWeek
return bool