C# Class DateTimeExtensions.WorkingDaysExtensions

Mostrar archivo Open project: kappy/DateTimeExtensions

Public Methods

Method Description
AddWorkingDays ( this day, int workingDays ) : System.DateTime

Adds or subctracts the number in workingDays as working days to day using the default IWorkingDayCultureInfo.

This algorithm is only efficient for small values of workingDays

AddWorkingDays ( this day, int workingDays, IWorkingDayCultureInfo workingDayCultureInfo ) : System.DateTime

Adds or subctracts the value in workingDays as working days to day.

This algorithm is only efficient for small values of workingDays.

AllYearHolidays ( this day ) : Holiday>.IDictionary

Retrieves the holidays that have and are still ocouring on the day year, using the default IWorkingDayCultureInfo.

AllYearHolidays ( this day, IWorkingDayCultureInfo workingDayCultureInfo ) : Holiday>.IDictionary

Retrieves the holidays that have and are still ocouring on the day year.

GetWorkingDays ( System.DateTime from, System.DateTime to, WorkingDayCultureInfo workingDayCultureInfo ) : int

Calculates the Workingdays in the range from / to

GetWorkingDays ( this from, System.DateTime to ) : int

Calculates the Workingdays in the range from / to

IsHoliday ( this day ) : bool

Checks if a specific day is a working day, using the default IWorkingDayCultureInfo.

IsHoliday ( this day, IWorkingDayCultureInfo workingDayCultureInfo ) : bool

Checks if a specific day is an holiday desregarding the day of the week.

IsWorkingDay ( this day ) : bool

Checks if a specific day is an holiday day, using the default IWorkingDayCultureInfo, desregarding the day of the week.

IsWorkingDay ( this day, IWorkingDayCultureInfo workingDayCultureInfo ) : bool

Checks if a specific day is a working day.

Method Details

AddWorkingDays() public static method

Adds or subctracts the number in workingDays as working days to day using the default IWorkingDayCultureInfo.
This algorithm is only efficient for small values of workingDays
public static AddWorkingDays ( this day, int workingDays ) : System.DateTime
day this The starting day.
workingDays int The number of working days to be added or subtracted.
return System.DateTime

AddWorkingDays() public static method

Adds or subctracts the value in workingDays as working days to day.
This algorithm is only efficient for small values of workingDays.
public static AddWorkingDays ( this day, int workingDays, IWorkingDayCultureInfo workingDayCultureInfo ) : System.DateTime
day this The starting day.
workingDays int The number of working days to be added or subtracted.
workingDayCultureInfo IWorkingDayCultureInfo The culture of working days to be used in the calculation. See for more information.
return System.DateTime

AllYearHolidays() public static method

Retrieves the holidays that have and are still ocouring on the day year, using the default IWorkingDayCultureInfo.
public static AllYearHolidays ( this day ) : Holiday>.IDictionary
day this The day used to gat the year from.
return Holiday>.IDictionary

AllYearHolidays() public static method

Retrieves the holidays that have and are still ocouring on the day year.
public static AllYearHolidays ( this day, IWorkingDayCultureInfo workingDayCultureInfo ) : Holiday>.IDictionary
day this The day used to gat the year from.
workingDayCultureInfo IWorkingDayCultureInfo The used the get the holidays.
return Holiday>.IDictionary

GetWorkingDays() public static method

Calculates the Workingdays in the range from / to
public static GetWorkingDays ( System.DateTime from, System.DateTime to, WorkingDayCultureInfo workingDayCultureInfo ) : int
from System.DateTime The starting day.
to System.DateTime The end day.
workingDayCultureInfo WorkingDayCultureInfo The culture of working days to be used in the calculation. See for more information.
return int

GetWorkingDays() public static method

Calculates the Workingdays in the range from / to
public static GetWorkingDays ( this from, System.DateTime to ) : int
from this The starting day.
to System.DateTime The end day.
return int

IsHoliday() public static method

Checks if a specific day is a working day, using the default IWorkingDayCultureInfo.
public static IsHoliday ( this day ) : bool
day this The day from calendar to check
return bool

IsHoliday() public static method

Checks if a specific day is an holiday desregarding the day of the week.
public static IsHoliday ( this day, IWorkingDayCultureInfo workingDayCultureInfo ) : bool
day this The day from calendar to check
workingDayCultureInfo IWorkingDayCultureInfo The used the check if the day is a working day
return bool

IsWorkingDay() public static method

Checks if a specific day is an holiday day, using the default IWorkingDayCultureInfo, desregarding the day of the week.
public static IsWorkingDay ( this day ) : bool
day this The day from calendar to check
return bool

IsWorkingDay() public static method

Checks if a specific day is a working day.
public static IsWorkingDay ( this day, IWorkingDayCultureInfo workingDayCultureInfo ) : bool
day this The day from calendar to check
workingDayCultureInfo IWorkingDayCultureInfo The used the check if the day is a working day
return bool