C# Class Rolcore.DateTimeUtils

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

Public Methods

Method Description
GetLastDayOfWeekInMonth ( int year, MonthOfYear month, DayOfWeek dayOfWeek ) : System.DateTime

Gets the last occurrence of the specified DayOfWeek within the given month and year.

GetNthDayOfWeekInMonth ( int year, MonthOfYear month, DayOfWeek dayOfWeek, short dayOccurences ) : System.DateTime

Gets the "Nth" day of the month (for example, the 3rd Monday in January) as a DateTime.

HolidaysByYear ( int year ) : System.DateTime[]

Gets a list of DateTimes that are holidays in the given year.

Method Details

GetLastDayOfWeekInMonth() public static method

Gets the last occurrence of the specified DayOfWeek within the given month and year.
public static GetLastDayOfWeekInMonth ( int year, MonthOfYear month, DayOfWeek dayOfWeek ) : System.DateTime
year int The year for which to calculate the desired date.
month MonthOfYear The month for which to calculate the desired date.
dayOfWeek DayOfWeek The to calculate.
return System.DateTime

GetNthDayOfWeekInMonth() public static method

Gets the "Nth" day of the month (for example, the 3rd Monday in January) as a DateTime.
public static GetNthDayOfWeekInMonth ( int year, MonthOfYear month, DayOfWeek dayOfWeek, short dayOccurences ) : System.DateTime
year int The year in which the date should be calculated.
month MonthOfYear The month (1 through 12) in which the date should be calculated.
dayOfWeek DayOfWeek The day of week to calculate in the given month and year.
dayOccurences short Which occurrence to calculate (1 through 5).
return System.DateTime

HolidaysByYear() public static method

Gets a list of DateTimes that are holidays in the given year.
public static HolidaysByYear ( int year ) : System.DateTime[]
year int The year in which to calculate holidays for.
return System.DateTime[]