C# Class Signum.Utilities.DateTimeExtensions

ファイルを表示 Open project: signumsoftware/framework

Public Methods

Method Description
Add ( this date, DateSpan dateSpan ) : System.DateTime
DateSpanTo ( this min, System.DateTime max ) : DateSpan
GetPrecision ( this dateTime ) : DateTimePrecision
JavascriptMilliseconds ( this dateTime ) : long
Max ( this a, System.DateTime b ) : System.DateTime
Max ( this a, System.DateTime b ) : DateTime?
Min ( this a, System.DateTime b ) : System.DateTime
Min ( this a, System.DateTime b ) : DateTime?
MonthStart ( this dateTime ) : System.DateTime
MonthsTo ( this start, System.DateTime end ) : int
SmartDatePattern ( this date ) : string
SmartDatePattern ( this date, System.DateTime currentdate ) : string
SmartShortDatePattern ( this date ) : string
SmartShortDatePattern ( this date, System.DateTime currentdate ) : string
ToAgoString ( this dateTime ) : string
ToAgoString ( this dateTime, System.DateTime now ) : string
ToMonthName ( this dateTime ) : string
ToShortMonthName ( this dateTime ) : string
TotalMonths ( this start, System.DateTime end ) : double
TrimTo ( this dateTime, DateTimePrecision precision ) : System.DateTime
TrimToHours ( this dateTime ) : System.DateTime
TrimToMinutes ( this dateTime ) : System.DateTime
TrimToSeconds ( this dateTime ) : System.DateTime
WeekNumber ( this dateTime ) : int
YearsTo ( this start, System.DateTime end ) : int

Private Methods

Method Description
AssertDateOnly ( System.DateTime date ) : void
IsInDateInterval ( this date, System.DateTime minDate, System.DateTime maxDate ) : bool
IsInInterval ( this date, System.DateTime minDate, System.DateTime maxDate ) : bool
NumberOfDaysAfterOneMonth ( System.DateTime monthStart ) : double

Method Details

Add() public static method

public static Add ( this date, DateSpan dateSpan ) : System.DateTime
date this
dateSpan DateSpan
return System.DateTime

DateSpanTo() public static method

public static DateSpanTo ( this min, System.DateTime max ) : DateSpan
min this
max System.DateTime
return DateSpan

GetPrecision() public static method

public static GetPrecision ( this dateTime ) : DateTimePrecision
dateTime this
return DateTimePrecision

JavascriptMilliseconds() public static method

public static JavascriptMilliseconds ( this dateTime ) : long
dateTime this
return long

Max() public static method

public static Max ( this a, System.DateTime b ) : System.DateTime
a this
b System.DateTime
return System.DateTime

Max() public static method

public static Max ( this a, System.DateTime b ) : DateTime?
a this
b System.DateTime
return DateTime?

Min() public static method

public static Min ( this a, System.DateTime b ) : System.DateTime
a this
b System.DateTime
return System.DateTime

Min() public static method

public static Min ( this a, System.DateTime b ) : DateTime?
a this
b System.DateTime
return DateTime?

MonthStart() public static method

public static MonthStart ( this dateTime ) : System.DateTime
dateTime this
return System.DateTime

MonthsTo() public static method

public static MonthsTo ( this start, System.DateTime end ) : int
start this
end System.DateTime
return int

SmartDatePattern() public static method

public static SmartDatePattern ( this date ) : string
date this
return string

SmartDatePattern() public static method

public static SmartDatePattern ( this date, System.DateTime currentdate ) : string
date this
currentdate System.DateTime
return string

SmartShortDatePattern() public static method

public static SmartShortDatePattern ( this date ) : string
date this
return string

SmartShortDatePattern() public static method

public static SmartShortDatePattern ( this date, System.DateTime currentdate ) : string
date this
currentdate System.DateTime
return string

ToAgoString() public static method

public static ToAgoString ( this dateTime ) : string
dateTime this
return string

ToAgoString() public static method

public static ToAgoString ( this dateTime, System.DateTime now ) : string
dateTime this
now System.DateTime
return string

ToMonthName() public static method

public static ToMonthName ( this dateTime ) : string
dateTime this
return string

ToShortMonthName() public static method

public static ToShortMonthName ( this dateTime ) : string
dateTime this
return string

TotalMonths() public static method

public static TotalMonths ( this start, System.DateTime end ) : double
start this
end System.DateTime
return double

TrimTo() public static method

public static TrimTo ( this dateTime, DateTimePrecision precision ) : System.DateTime
dateTime this
precision DateTimePrecision Using Milliseconds does nothing, using Days use DateTime.Date
return System.DateTime

TrimToHours() public static method

public static TrimToHours ( this dateTime ) : System.DateTime
dateTime this
return System.DateTime

TrimToMinutes() public static method

public static TrimToMinutes ( this dateTime ) : System.DateTime
dateTime this
return System.DateTime

TrimToSeconds() public static method

public static TrimToSeconds ( this dateTime ) : System.DateTime
dateTime this
return System.DateTime

WeekNumber() public static method

public static WeekNumber ( this dateTime ) : int
dateTime this
return int

YearsTo() public static method

public static YearsTo ( this start, System.DateTime end ) : int
start this
end System.DateTime
return int