DateTimeComparisonExtensions extension

Extension providing comparison operators for DateTime objects Adds <=, >=, >, < operators for DateTime with DateTime? comparison

on

Methods

isBetween(DateTime? start, DateTime? end) bool

Available on DateTime, provided by the DateTimeComparisonExtensions extension

Check if this DateTime is between two other DateTimes (inclusive) Returns false if any of the DateTimes is null
isBetweenExclusive(DateTime? start, DateTime? end) bool

Available on DateTime, provided by the DateTimeComparisonExtensions extension

Check if this DateTime is between two other DateTimes (exclusive) Returns false if any of the DateTimes is null
isEqualTo(DateTime? other) bool

Available on DateTime, provided by the DateTimeComparisonExtensions extension

Check if this DateTime equals another nullable DateTime Returns false if other is null

Operators

operator <(DateTime? other) bool

Available on DateTime, provided by the DateTimeComparisonExtensions extension

Less than operator for DateTime with nullable DateTime Returns false if other is null
operator <=(DateTime? other) bool

Available on DateTime, provided by the DateTimeComparisonExtensions extension

Less than or equal operator for DateTime with nullable DateTime Returns false if other is null
operator >(DateTime? other) bool

Available on DateTime, provided by the DateTimeComparisonExtensions extension

Greater than operator for DateTime with nullable DateTime Returns false if other is null
operator >=(DateTime? other) bool

Available on DateTime, provided by the DateTimeComparisonExtensions extension

Greater than or equal operator for DateTime with nullable DateTime Returns false if other is null