Struct DateRange
- Namespace
- BlazOrbit.Components
- Assembly
- BlazOrbit.Core.dll
Inclusive start/end date pair used by BOBInputDateRange (BlazOrbit.Components.Forms).
Either bound may be null to indicate an open-ended range.
public readonly struct DateRange
Constructors
DateRange(DateOnly?, DateOnly?)
Inclusive start/end date pair used by BOBInputDateRange (BlazOrbit.Components.Forms).
Either bound may be null to indicate an open-ended range.
public DateRange(DateOnly? Start, DateOnly? End)
Parameters
StartDateOnly?Start of the range, inclusive.
EndDateOnly?End of the range, inclusive. Must be greater than or equal to
Startwhen both are set.
Properties
DayCount
public int DayCount { get; }
Property Value
- int
End
End of the range, inclusive. Must be greater than or equal to Start when both are set.
public DateOnly? End { get; init; }
Property Value
- DateOnly?
IsComplete
Both bounds are set.
public bool IsComplete { get; }
Property Value
- bool
IsEmpty
Both bounds are unset.
public bool IsEmpty { get; }
Property Value
- bool
Start
Start of the range, inclusive.
public DateOnly? Start { get; init; }
Property Value
- DateOnly?
Methods
Contains(DateOnly)
Returns true when date falls within the inclusive
range. Open-ended ranges treat the missing bound as unbounded on that side.
public bool Contains(DateOnly date)
Parameters
dateDateOnly
Returns
- bool
Last30Days()
Last 30 days ending today (inclusive).
public static DateRange Last30Days()
Returns
Last7Days()
Last 7 days ending today (inclusive).
public static DateRange Last7Days()
Returns
ThisMonth()
The current calendar month.
public static DateRange ThisMonth()