C# Класс Aspectacular.RelativeTimeSpan

More intuitive time range specification, than start date - end date type of date/time range. For example, "PreviousExcludingCurrent 3 quarters", "Current week", "Past 48 hours".
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Direction Timeline
Unit TimeUnits
UnitCount ulong

Открытые методы

Метод Описание
GetDateTimeRange ( System.DateTime referenceMoment ) : DateRange
GetTimeMomentRange ( 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.

RelativeTimeSpan ( Timeline direction, TimeUnits unit, ulong unitCount = 1 ) : System

Описание методов

GetDateTimeRange() публичный Метод

public GetDateTimeRange ( System.DateTime referenceMoment ) : DateRange
referenceMoment System.DateTime
Результат DateRange

GetTimeMomentRange() публичный Метод

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 GetTimeMomentRange ( DateTimeOffset referenceMoment = null ) : TimeMomentRange
referenceMoment DateTimeOffset
Результат TimeMomentRange

RelativeTimeSpan() публичный Метод

public RelativeTimeSpan ( Timeline direction, TimeUnits unit, ulong unitCount = 1 ) : System
direction Timeline
unit TimeUnits
unitCount ulong
Результат System

Описание свойств

Direction публичное свойство

public Timeline Direction
Результат Timeline

Unit публичное свойство

public TimeUnits Unit
Результат TimeUnits

UnitCount публичное свойство

public ulong UnitCount
Результат ulong