C# Class TypeLess.Net.DateHelper

Afficher le fichier Open project: jansater/TypeLess

Méthodes publiques

Méthode Description
GetDaysInPeriod ( System.DateTime startDate, System.DateTime endDate ) : int

Returns the number of days in a period

GetEndOfDay ( System.DateTime date ) : System.DateTime
GetEndOfMonth ( System.DateTime date ) : System.DateTime
GetEndOfMonth ( int monthOffsetFromCurrentMonth ) : System.DateTime
GetEndOfYear ( System.DateTime now ) : System.DateTime
GetNextQuarter ( System.DateTime date ) : int
GetNumberOfDaysInMonth ( System.DateTime date ) : int
GetNumberOfDaysInMonthExcludingWeekday ( System.DateTime date, DayOfWeek day ) : int
GetNumberOfDaysPastExcludingWeekday ( System.DateTime date, DayOfWeek day ) : int
GetNumberOfWeekdaysInDaysPast ( System.DateTime date, DayOfWeek day ) : int

Gets the number of the given weekday in the days past in the month of the given date

GetNumberOfWeekdaysInMonth ( System.DateTime date, DayOfWeek day ) : int

Gets the number of the given weekday in the month of the given date

GetPreviousQuarter ( System.DateTime date ) : int
GetQuarter ( System.DateTime date ) : int
GetQuarterEndDate ( System.DateTime date ) : System.DateTime
GetQuarterEndDate ( int year, int quarter ) : System.DateTime
GetQuarterStartDate ( System.DateTime date ) : System.DateTime
GetQuarterStartDate ( int year, int quarter ) : System.DateTime
GetStartAndEndOfWeek ( int year, int week, System.DateTime &startOfWeek, System.DateTime &endOfWeek, CalendarWeekRule cwr, DayOfWeek firstDayOfWeek ) : void
GetStartOfDay ( System.DateTime date ) : System.DateTime
GetStartOfMonth ( System.DateTime date ) : System.DateTime
GetStartOfMonth ( int monthOffsetFromCurrentMonth ) : System.DateTime
GetStartOfYear ( System.DateTime now ) : System.DateTime
IsInSameMonth ( System.DateTime startDate, System.DateTime endDate ) : bool
IsInSameYear ( System.DateTime startDate, System.DateTime endDate ) : bool
OccursWithinDaysAfter ( System.DateTime date, int days, System.DateTime fromDate ) : bool

Returns true if date occurs within days after or on fromDate

OccursWithinDaysBefore ( System.DateTime date, int days, System.DateTime fromDate ) : bool

Returns true if date occurs within days before or on fromDate

Method Details

GetDaysInPeriod() public static méthode

Returns the number of days in a period
public static GetDaysInPeriod ( System.DateTime startDate, System.DateTime endDate ) : int
startDate System.DateTime
endDate System.DateTime
Résultat int

GetEndOfDay() public static méthode

public static GetEndOfDay ( System.DateTime date ) : System.DateTime
date System.DateTime
Résultat System.DateTime

GetEndOfMonth() public static méthode

public static GetEndOfMonth ( System.DateTime date ) : System.DateTime
date System.DateTime
Résultat System.DateTime

GetEndOfMonth() public static méthode

public static GetEndOfMonth ( int monthOffsetFromCurrentMonth ) : System.DateTime
monthOffsetFromCurrentMonth int
Résultat System.DateTime

GetEndOfYear() public static méthode

public static GetEndOfYear ( System.DateTime now ) : System.DateTime
now System.DateTime
Résultat System.DateTime

GetNextQuarter() public static méthode

public static GetNextQuarter ( System.DateTime date ) : int
date System.DateTime
Résultat int

GetNumberOfDaysInMonth() public static méthode

public static GetNumberOfDaysInMonth ( System.DateTime date ) : int
date System.DateTime
Résultat int

GetNumberOfDaysInMonthExcludingWeekday() public static méthode

public static GetNumberOfDaysInMonthExcludingWeekday ( System.DateTime date, DayOfWeek day ) : int
date System.DateTime
day DayOfWeek
Résultat int

GetNumberOfDaysPastExcludingWeekday() public static méthode

public static GetNumberOfDaysPastExcludingWeekday ( System.DateTime date, DayOfWeek day ) : int
date System.DateTime
day DayOfWeek
Résultat int

GetNumberOfWeekdaysInDaysPast() public static méthode

Gets the number of the given weekday in the days past in the month of the given date
public static GetNumberOfWeekdaysInDaysPast ( System.DateTime date, DayOfWeek day ) : int
date System.DateTime
day DayOfWeek
Résultat int

GetNumberOfWeekdaysInMonth() public static méthode

Gets the number of the given weekday in the month of the given date
public static GetNumberOfWeekdaysInMonth ( System.DateTime date, DayOfWeek day ) : int
date System.DateTime
day DayOfWeek
Résultat int

GetPreviousQuarter() public static méthode

public static GetPreviousQuarter ( System.DateTime date ) : int
date System.DateTime
Résultat int

GetQuarter() public static méthode

public static GetQuarter ( System.DateTime date ) : int
date System.DateTime
Résultat int

GetQuarterEndDate() public static méthode

public static GetQuarterEndDate ( System.DateTime date ) : System.DateTime
date System.DateTime
Résultat System.DateTime

GetQuarterEndDate() public static méthode

public static GetQuarterEndDate ( int year, int quarter ) : System.DateTime
year int
quarter int
Résultat System.DateTime

GetQuarterStartDate() public static méthode

public static GetQuarterStartDate ( System.DateTime date ) : System.DateTime
date System.DateTime
Résultat System.DateTime

GetQuarterStartDate() public static méthode

public static GetQuarterStartDate ( int year, int quarter ) : System.DateTime
year int
quarter int
Résultat System.DateTime

GetStartAndEndOfWeek() public static méthode

public static GetStartAndEndOfWeek ( int year, int week, System.DateTime &startOfWeek, System.DateTime &endOfWeek, CalendarWeekRule cwr, DayOfWeek firstDayOfWeek ) : void
year int
week int
startOfWeek System.DateTime
endOfWeek System.DateTime
cwr CalendarWeekRule
firstDayOfWeek DayOfWeek
Résultat void

GetStartOfDay() public static méthode

public static GetStartOfDay ( System.DateTime date ) : System.DateTime
date System.DateTime
Résultat System.DateTime

GetStartOfMonth() public static méthode

public static GetStartOfMonth ( System.DateTime date ) : System.DateTime
date System.DateTime
Résultat System.DateTime

GetStartOfMonth() public static méthode

public static GetStartOfMonth ( int monthOffsetFromCurrentMonth ) : System.DateTime
monthOffsetFromCurrentMonth int
Résultat System.DateTime

GetStartOfYear() public static méthode

public static GetStartOfYear ( System.DateTime now ) : System.DateTime
now System.DateTime
Résultat System.DateTime

IsInSameMonth() public static méthode

public static IsInSameMonth ( System.DateTime startDate, System.DateTime endDate ) : bool
startDate System.DateTime
endDate System.DateTime
Résultat bool

IsInSameYear() public static méthode

public static IsInSameYear ( System.DateTime startDate, System.DateTime endDate ) : bool
startDate System.DateTime
endDate System.DateTime
Résultat bool

OccursWithinDaysAfter() public static méthode

Returns true if date occurs within days after or on fromDate
public static OccursWithinDaysAfter ( System.DateTime date, int days, System.DateTime fromDate ) : bool
date System.DateTime
days int
fromDate System.DateTime
Résultat bool

OccursWithinDaysBefore() public static méthode

Returns true if date occurs within days before or on fromDate
public static OccursWithinDaysBefore ( System.DateTime date, int days, System.DateTime fromDate ) : bool
date System.DateTime
days int
fromDate System.DateTime
Résultat bool