DateRange Structure

Represents a range of time with a defined beginning and ending.

Definition

Namespace: InnerDrive.Core
Assembly: InnerDrive.Core (in InnerDrive.Core.dll) Version: 5.2.9017.0
C#
public struct DateRange : IRange<DateTimeOffset>, 
	IComparable, IComparable<DateRange>, IFormattable
Inheritance
Object    ValueType    DateRange
Implements
IRangeDateTimeOffset, IComparable, IComparableDateRange, IFormattable

Constructors

DateRange(IEnumerableDateTime) Creates a new instance of DateRange from a generic list of DateTime values.
DateRange(IEnumerableDateTimeOffset) Creates a new instance of DateRange from a generic list of DateTimeOffset values.
DateRange(IRangeDateTimeOffset) Creates a new instance of DateRange from an existing date range value.
DateRange(DateTimeOffset, DateTimeOffset) Creates a new instance of DateRange equal to the range between two DateTimeOffset values.
DateRange(DateTimeOffset, TimeSpan) Creates a new instance of DateRange from existing DateTimeOffset and TimeSpan values.
DateRange(DateTime, DateTime, TimeSpan) Creates a new instance of DateRange equal to the range between two DateTime values.

Properties

IsLowerInclusive If true, the date range includes the Lower value. Otherwise, values equal to or less than the Lower value are out of the range.
IsUpperInclusive If true, the range includes the Upper value. Otherwise, values equal to or greater than the Upper value are out of the range.
Last12Months Gets a DateRange representing the preceding 12 months from midnight to midnight in the current Offset using the current DateTimeFormat rule
LastMonth Gets a DateRange representing the preceding month from midnight to midnight in the current Offset using the current DateTimeFormat rule
LastWeek Gets a DateRange representing the preceding week from midnight to midnight in the current Offset using the current DateTimeFormat rule
LastYear Gets a DateRange representing the preceding year from midnight to midnight in the current Offset using the current DateTimeFormat rule
Lower Gets or sets the lowest value in the range.
ThisMonth Gets a DateRange representing the current month from midnight to midnight in the current Offset using the current DateTimeFormat rule
ThisWeek Gets a DateRange representing the current week from midnight to midnight in the current Offset using the current DateTimeFormat rule
ThisYear Gets a DateRange representing the current year from midnight to midnight in the current Offset using the current DateTimeFormat rule
ThisYearToDate Gets a DateRange representing the current year through today's date from midnight to midnight in the current Offset using the current DateTimeFormat rule
TimeSpan Gets the duration implied by the date range.
Today Gets a DateRange representing the current date from midnight to midnight in the current Offset
Upper Gets or sets the highest value in the range.
Yesterday Gets a DateRange representing the date before the current date from midnight to midnight in the current Offset

Methods

CompareTo(DateRange) Compares the current instance with another DateRange.
CompareTo(DateTimeOffset) Compares this instance to a specified DateTimeOffset structure and returns an indication of their relative values.
Contains(DateTimeOffset) Returns true if the given DateTimeOffset is contained within this range.
Contains(IRangeDateTimeOffset) Returns true if the given range is contained within this range.
Contains(NullableDateRange) Returns true if the given DateRange is contained within this range.
Equals(DateRange) Determines whether the specified DateRange is equal to the current DateRange.
Equals(Object) Determines whether the specified Object is equal to the current DateRange.
(Overrides ValueTypeEquals(Object))
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCode Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
(Overrides ValueTypeGetHashCode)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Overlaps(DateRange) Returns true if the given DateRange is partially contained within this DateRange.
Overlaps(IRangeDateTimeOffset) Returns true if the given range is partially contained within this range.
ToOffset Converts the value of the current DateRange object to the date range specified by an offset value.
ToString Converts the value of this instance to its equivalent string representation.
(Overrides ValueTypeToString)
ToString(IFormatProvider) Converts the value of this instance to its equivalent string representation using the specified culture-specific format information.
ToString(String) Converts the value of this instance to its equivalent string representation using the specified format.
ToString(String, IFormatProvider) Converts the value of this instance to its equivalent string representation using the specified format and culture-specific format information.

Operators

Equality(DateRange, DateRange) Compares two instances of DateRange for equality.
GreaterThan(DateRange, DateRange) Determines whether one DateRange is greater than another.
Inequality(DateRange, DateRange) Compares two instances of DateRange for inequality.
LessThan(DateRange, DateRange) Determines whether one DateRange is less than another.

Fields

SqlDateTimeValidRange Gets the minimum and maximum allowable values for the SQL datetime data type.
SqlSmallDateTimeValidRange Gets the minimum and maximum allowable values for the SQL smalldatetime data type.

Explicit Interface Implementations

IComparableCompareTo Compares this instance to a specified Object and returns an indication of their relative values.

See Also