C# Class Rolcore.DateTimeExtensions

Extension methods for DateTime.
Datei anzeigen Open project: Rollins/Rolcore

Public Methods

Method Description
GetDateInSortableDateTimeFormat ( this date ) : string

Gets the given Date in sortable datetime format

IsHoliday ( this date ) : bool

Determines if the given DateTime is a holiday or not.

IsWeekend ( this date ) : bool

Determines if the given DateTime occurs on a weekend.

NearestWeekday ( this date ) : System.DateTime

Gets the nearest weekday (Monday through Friday) for the given DateTime.

Next ( this date, DateTimeUnit unit, int count ) : IEnumerable
Previous ( this date, DateTimeUnit unit, int count ) : IEnumerable

Method Details

GetDateInSortableDateTimeFormat() public static method

Gets the given Date in sortable datetime format
public static GetDateInSortableDateTimeFormat ( this date ) : string
date this
return string

IsHoliday() public static method

Determines if the given DateTime is a holiday or not.
public static IsHoliday ( this date ) : bool
date this The date to determine if it is a holiday.
return bool

IsWeekend() public static method

Determines if the given DateTime occurs on a weekend.
public static IsWeekend ( this date ) : bool
date this The date to determine if it occurs on a weekend.
return bool

NearestWeekday() public static method

Gets the nearest weekday (Monday through Friday) for the given DateTime.
public static NearestWeekday ( this date ) : System.DateTime
date this The date on which to calculate the nearest weekday.
return System.DateTime

Next() public static method

public static Next ( this date, DateTimeUnit unit, int count ) : IEnumerable
date this
unit DateTimeUnit
count int
return IEnumerable

Previous() public static method

public static Previous ( this date, DateTimeUnit unit, int count ) : IEnumerable
date this
unit DateTimeUnit
count int
return IEnumerable