DateRange
Defines a Range of Type DateTime
Constructors
public DateRange()
dateRange = DateRange()
Initializes a new instance of the DateRange class.
public DateRange(DateTime min, DateTime max)
dateRange = DateRange(min, max)
Initializes a new instance of the DateRange class.
- min
- The min.
- max
- The max.
Properties
public override DateTime Diff { get; }
value = dateRange.Diff
Gets the difference (Max - Min) of this range
public override bool IsZero { get; }
value = dateRange.IsZero
Gets whether the range is Zero, where Max equals Min
Methods
public override DoubleRange AsDoubleRange()
result = dateRange.AsDoubleRange()
Converts this range to a DoubleRange, which are used internally for calculations
public override IRange<DateTime> ClipTo(IRange<DateTime> maximumRange)
result = dateRange.ClipTo(maximumRange)
Clips the current IRange to a maxmimum range
- maximumRange
- The Maximum Range
Returns: This instance, after the operation
public override IRange<DateTime> GrowBy(double minFraction, double maxFraction)
result = dateRange.GrowBy(minFraction, maxFraction)
Grows the current IRange by the min and max fraction, returning this instance after modification
- minFraction
- The Min fraction to grow by. For example, Min = -10 and minFraction = 0.1 will result in the new Min = -11
- maxFraction
- The Max fraction to grow by. For example, Max = 10 and minFraction = 0.2 will result in the new Max = 12
Returns: This instance, after the operation
public override IRange<DateTime> SetMinMax(double min, double max)
result = dateRange.SetMinMax(min, max)
Sets the Min, Max values on the IRange, returning this instance after modification
- min
- The new Min value.
- max
- The new Max value.
Returns: This instance, after the operation
public override IRange<DateTime> SetMinMax(double min, double max, IRange<DateTime> maxRange)
result = dateRange.SetMinMax(min, max, maxRange)
Sets the Min, Max values on the IRange with a maximum range limit, returning this instance after modification
- min
- The new Min value.
- max
- The new Max value.
- maxRange
- The max range.
Returns: This instance, after the operation
public override string ToString()
result = dateRange.ToString()
Returns a String that represents this instance.
Returns: A String that represents this instance.