public GetTimeMomentRange ( DateTimeOffset referenceMoment = null ) : TimeMomentRange | ||
referenceMoment | DateTimeOffset | |
return | TimeMomentRange |
/// <summary> /// 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. /// </summary> /// <param name="unit"></param> /// <param name="unitCount"></param> /// <param name="referenceMoment"></param> /// <returns></returns> public static TimeMomentRange Next(this TimeUnits unit, ulong unitCount = 1, DateTimeOffset?referenceMoment = null) { var span = new RelativeTimeSpan(Timeline.NextExcludingCurrent, unit, unitCount); TimeMomentRange range = span.GetTimeMomentRange(referenceMoment); return(range); }
/// <summary> /// 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. /// </summary> /// <param name="unit"></param> /// <param name="referenceMoment"></param> /// <returns></returns> public static TimeMomentRange ToDate(this TimeUnits unit, DateTimeOffset?referenceMoment = null) { var span = new RelativeTimeSpan(Timeline.ToDateOrTillSpecified, unit); TimeMomentRange range = span.GetTimeMomentRange(referenceMoment); return(range); }
/// <summary> /// 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. /// </summary> /// <param name="unit"></param> /// <param name="referenceMoment"></param> /// <returns></returns> public static TimeMomentRange ToDate(this TimeUnits unit, DateTimeOffset? referenceMoment = null) { var span = new RelativeTimeSpan(Timeline.ToDateOrTillSpecified, unit); TimeMomentRange range = span.GetTimeMomentRange(referenceMoment); return range; }
/// <summary> /// 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. /// </summary> /// <param name="unit"></param> /// <param name="unitCount"></param> /// <param name="referenceMoment"></param> /// <returns></returns> public static TimeMomentRange Previous(this TimeUnits unit, ulong unitCount = 1, DateTimeOffset? referenceMoment = null) { var span = new RelativeTimeSpan(Timeline.PreviousExcludingCurrent, unit, unitCount); TimeMomentRange range = span.GetTimeMomentRange(referenceMoment); return range; }
/// <summary> /// 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. /// </summary> /// <param name="unit"></param> /// <param name="unitCount"></param> /// <param name="referenceMoment"></param> /// <returns></returns> public static TimeMomentRange Future(this TimeUnits unit, ulong unitCount = 1, DateTimeOffset? referenceMoment = null) { var span = new RelativeTimeSpan(Timeline.Future, unit, unitCount); TimeMomentRange range = span.GetTimeMomentRange(referenceMoment); return range; }