C# Class Aspectacular.RelativeTimeSpanExtensions

Datei anzeigen Open project: vgribok/Aspectacular

Public Methods

Method Description
Add ( this dt, int count, TimeUnits unit ) : System.DateTime
Add ( this dt, int count, TimeUnits unit ) : DateTimeOffset

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

CalculationParent ( this unit ) : TimeUnits?

Returns higher time Unit in which the given Unit is *repeated within*. This is not a direct hierarchy! Different types of units may have same parent. For example, Month number 1..12 is repeated within a Year, so Month's parent is Year, not quarter. Quarter 1..4 also is repeated within a year, so Quarter's parent is also year. Same goes for Week number 1..52.

Current ( this unit, System.DateTime referenceMoment ) : DateRange
Current ( this unit, DateTimeOffset referenceMoment = null ) : TimeMomentRange

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

EndOf ( this dt, TimeUnits unit ) : System.DateTime
EndOf ( this dt, TimeUnits unit ) : DateTimeOffset

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

Future ( this unit, ulong unitCount, System.DateTime referenceMoment ) : DateRange
Future ( this unit, ulong unitCount = 1, DateTimeOffset referenceMoment = null ) : TimeMomentRange

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

IsMomentInTime ( this unit ) : bool
Next ( this unit, ulong unitCount, System.DateTime referenceMoment ) : DateRange
Next ( this unit, ulong unitCount = 1, DateTimeOffset referenceMoment = null ) : TimeMomentRange

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

Past ( this unit, ulong unitCount, System.DateTime referenceMoment ) : DateRange
Past ( this unit, ulong unitCount = 1, DateTimeOffset referenceMoment = null ) : TimeMomentRange

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

Previous ( this unit, ulong unitCount, System.DateTime referenceMoment ) : DateRange
Previous ( this unit, ulong unitCount = 1, DateTimeOffset referenceMoment = null ) : TimeMomentRange

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

RangeCurrent ( this dt, TimeUnits unit ) : DateRange
RangeCurrent ( this dt, TimeUnits unit ) : TimeMomentRange

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

RangeFuture ( this dt, ulong unitCount, TimeUnits unit ) : DateRange
RangeFuture ( this dt, ulong unitCount, TimeUnits unit ) : TimeMomentRange

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

RangeNext ( this dt, ulong unitCount, TimeUnits unit ) : DateRange
RangeNext ( this dt, ulong unitCount, TimeUnits unit ) : TimeMomentRange

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

RangePast ( this dt, ulong unitCount, TimeUnits unit ) : DateRange
RangePast ( this dt, ulong unitCount, TimeUnits unit ) : TimeMomentRange

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

RangePrevious ( this dt, ulong unitCount, TimeUnits unit ) : DateRange
RangePrevious ( this dt, ulong unitCount, TimeUnits unit ) : TimeMomentRange

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

RangeToDate ( this dt, TimeUnits unit ) : DateRange
RangeToDate ( this dt, TimeUnits unit ) : TimeMomentRange

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

StartOf ( this dt, TimeUnits unit ) : System.DateTime
StartOf ( this dt, TimeUnits unit ) : DateTimeOffset

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

ToDate ( this unit, System.DateTime referenceMoment ) : DateRange
ToDate ( this unit, DateTimeOffset referenceMoment = null ) : TimeMomentRange

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.

Method Details

Add() public static method

public static Add ( this dt, int count, TimeUnits unit ) : System.DateTime
dt this
count int
unit TimeUnits
return System.DateTime

Add() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static Add ( this dt, int count, TimeUnits unit ) : DateTimeOffset
dt this
count int
unit TimeUnits
return DateTimeOffset

CalculationParent() public static method

Returns higher time Unit in which the given Unit is *repeated within*. This is not a direct hierarchy! Different types of units may have same parent. For example, Month number 1..12 is repeated within a Year, so Month's parent is Year, not quarter. Quarter 1..4 also is repeated within a year, so Quarter's parent is also year. Same goes for Week number 1..52.
public static CalculationParent ( this unit ) : TimeUnits?
unit this
return TimeUnits?

Current() public static method

public static Current ( this unit, System.DateTime referenceMoment ) : DateRange
unit this
referenceMoment System.DateTime
return DateRange

Current() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static Current ( this unit, DateTimeOffset referenceMoment = null ) : TimeMomentRange
unit this
referenceMoment DateTimeOffset
return TimeMomentRange

EndOf() public static method

public static EndOf ( this dt, TimeUnits unit ) : System.DateTime
dt this
unit TimeUnits
return System.DateTime

EndOf() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static EndOf ( this dt, TimeUnits unit ) : DateTimeOffset
dt this
unit TimeUnits
return DateTimeOffset

Future() public static method

public static Future ( this unit, ulong unitCount, System.DateTime referenceMoment ) : DateRange
unit this
unitCount ulong
referenceMoment System.DateTime
return DateRange

Future() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static Future ( this unit, ulong unitCount = 1, DateTimeOffset referenceMoment = null ) : TimeMomentRange
unit this
unitCount ulong
referenceMoment DateTimeOffset
return TimeMomentRange

IsMomentInTime() public static method

public static IsMomentInTime ( this unit ) : bool
unit this
return bool

Next() public static method

public static Next ( this unit, ulong unitCount, System.DateTime referenceMoment ) : DateRange
unit this
unitCount ulong
referenceMoment System.DateTime
return DateRange

Next() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static Next ( this unit, ulong unitCount = 1, DateTimeOffset referenceMoment = null ) : TimeMomentRange
unit this
unitCount ulong
referenceMoment DateTimeOffset
return TimeMomentRange

Past() public static method

public static Past ( this unit, ulong unitCount, System.DateTime referenceMoment ) : DateRange
unit this
unitCount ulong
referenceMoment System.DateTime
return DateRange

Past() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static Past ( this unit, ulong unitCount = 1, DateTimeOffset referenceMoment = null ) : TimeMomentRange
unit this
unitCount ulong
referenceMoment DateTimeOffset
return TimeMomentRange

Previous() public static method

public static Previous ( this unit, ulong unitCount, System.DateTime referenceMoment ) : DateRange
unit this
unitCount ulong
referenceMoment System.DateTime
return DateRange

Previous() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static Previous ( this unit, ulong unitCount = 1, DateTimeOffset referenceMoment = null ) : TimeMomentRange
unit this
unitCount ulong
referenceMoment DateTimeOffset
return TimeMomentRange

RangeCurrent() public static method

public static RangeCurrent ( this dt, TimeUnits unit ) : DateRange
dt this
unit TimeUnits
return DateRange

RangeCurrent() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static RangeCurrent ( this dt, TimeUnits unit ) : TimeMomentRange
dt this
unit TimeUnits
return TimeMomentRange

RangeFuture() public static method

public static RangeFuture ( this dt, ulong unitCount, TimeUnits unit ) : DateRange
dt this
unitCount ulong
unit TimeUnits
return DateRange

RangeFuture() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static RangeFuture ( this dt, ulong unitCount, TimeUnits unit ) : TimeMomentRange
dt this
unitCount ulong
unit TimeUnits
return TimeMomentRange

RangeNext() public static method

public static RangeNext ( this dt, ulong unitCount, TimeUnits unit ) : DateRange
dt this
unitCount ulong
unit TimeUnits
return DateRange

RangeNext() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static RangeNext ( this dt, ulong unitCount, TimeUnits unit ) : TimeMomentRange
dt this
unitCount ulong
unit TimeUnits
return TimeMomentRange

RangePast() public static method

public static RangePast ( this dt, ulong unitCount, TimeUnits unit ) : DateRange
dt this
unitCount ulong
unit TimeUnits
return DateRange

RangePast() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static RangePast ( this dt, ulong unitCount, TimeUnits unit ) : TimeMomentRange
dt this
unitCount ulong
unit TimeUnits
return TimeMomentRange

RangePrevious() public static method

public static RangePrevious ( this dt, ulong unitCount, TimeUnits unit ) : DateRange
dt this
unitCount ulong
unit TimeUnits
return DateRange

RangePrevious() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static RangePrevious ( this dt, ulong unitCount, TimeUnits unit ) : TimeMomentRange
dt this
unitCount ulong
unit TimeUnits
return TimeMomentRange

RangeToDate() public static method

public static RangeToDate ( this dt, TimeUnits unit ) : DateRange
dt this
unit TimeUnits
return DateRange

RangeToDate() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static RangeToDate ( this dt, TimeUnits unit ) : TimeMomentRange
dt this
unit TimeUnits
return TimeMomentRange

StartOf() public static method

public static StartOf ( this dt, TimeUnits unit ) : System.DateTime
dt this
unit TimeUnits
return System.DateTime

StartOf() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static StartOf ( this dt, TimeUnits unit ) : DateTimeOffset
dt this
unit TimeUnits
return DateTimeOffset

ToDate() public static method

public static ToDate ( this unit, System.DateTime referenceMoment ) : DateRange
unit this
referenceMoment System.DateTime
return DateRange

ToDate() public static method

Warning: bug found. dt.Offset may be incorrect as offsets could be different if range crosses daylight saving switch, i.e. October - December, or month of November in the EST USA.
public static ToDate ( this unit, DateTimeOffset referenceMoment = null ) : TimeMomentRange
unit this
referenceMoment DateTimeOffset
return TimeMomentRange