C# Class BudgetAnalyser.Engine.DateTimeExtension

An extension for DateTime.
ファイルを表示 Open project: Benrnz/BudgetAnalyser

Public Methods

Method Description
DurationInMonths ( this minDate, System.DateTime maxDate ) : int

Works out the duration in whole months between the two dates. The end date must be at least one whole calendar month ahead of the instance date to deemed one month.

FindNextWeekday ( this instance ) : System.DateTime

Increments the day until it is not a weekend. If the given date is already a weekday, the same date is returned.

FirstDateInMonth ( this instance ) : System.DateTime

Returns the first day of the current calendar month.

LastDateInMonth ( this instance ) : System.DateTime

Returns the last day of the given month.

Method Details

DurationInMonths() public static method

Works out the duration in whole months between the two dates. The end date must be at least one whole calendar month ahead of the instance date to deemed one month.
public static DurationInMonths ( this minDate, System.DateTime maxDate ) : int
minDate this
maxDate System.DateTime
return int

FindNextWeekday() public static method

Increments the day until it is not a weekend. If the given date is already a weekday, the same date is returned.
public static FindNextWeekday ( this instance ) : System.DateTime
instance this
return System.DateTime

FirstDateInMonth() public static method

Returns the first day of the current calendar month.
public static FirstDateInMonth ( this instance ) : System.DateTime
instance this
return System.DateTime

LastDateInMonth() public static method

Returns the last day of the given month.
public static LastDateInMonth ( this instance ) : System.DateTime
instance this
return System.DateTime