Table of Contents

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

Start DateOnly?

Start of the range, inclusive.

End DateOnly?

End of the range, inclusive. Must be greater than or equal to Start when both are set.

Properties

DayCount

Day count between Start and End, inclusive. Returns 0 when either bound is missing.

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

date DateOnly

Returns

bool

Last30Days()

Last 30 days ending today (inclusive).

public static DateRange Last30Days()

Returns

DateRange

Last7Days()

Last 7 days ending today (inclusive).

public static DateRange Last7Days()

Returns

DateRange

ThisMonth()

The current calendar month.

public static DateRange ThisMonth()

Returns

DateRange