Click or drag to resize

DateRange Structure

Represents a range of time with a defined beginning and ending.
Inheritance Hierarchy
SystemObject
  SystemValueType
    InnerDrive.CoreDateRange

Namespace: InnerDrive.Core
Assembly: InnerDrive.Core (in InnerDrive.Core.dll) Version: 5.0.8475.0
Syntax
C#
public struct DateRange : IRange<DateTimeOffset>, 
	IComparable, IComparable<DateRange>, IFormattable

The DateRange type exposes the following members.

Constructors
 NameDescription
Public methodDateRange(IEnumerableDateTime) Creates a new instance of DateRange from a generic list of DateTime values.
Public methodDateRange(IEnumerableDateTimeOffset) Creates a new instance of DateRange from a generic list of DateTimeOffset values.
Public methodDateRange(IRangeDateTimeOffset) Creates a new instance of DateRange from an existing date range value.
Public methodDateRange(DateTimeOffset, DateTimeOffset) Creates a new instance of DateRange equal to the range between two DateTimeOffset values.
Public methodDateRange(DateTimeOffset, TimeSpan) Creates a new instance of DateRange from existing DateTimeOffset and TimeSpan values.
Public methodDateRange(DateTime, DateTime, TimeSpan) Creates a new instance of DateRange equal to the range between two DateTime values.
Top
Properties
 NameDescription
Public propertyIsLowerInclusive If true, the date range includes the Lower value. Otherwise values equal to or less than the Lower value are out of the range.
Public propertyIsUpperInclusive If true, the range includes the Upper value. Otherwise values equal to or greater than the Upper value are out of the range.
Public propertyStatic memberLast12Months Gets a DateRange representing the preceding 12 months from midnight to midnight in the current Offset using the current DateTimeFormat rule
Public propertyStatic memberLastMonth Gets a DateRange representing the preceding month from midnight to midnight in the current Offset using the current DateTimeFormat rule
Public propertyStatic memberLastWeek Gets a DateRange representing the preceding week from midnight to midnight in the current Offset using the current DateTimeFormat rule
Public propertyStatic memberLastYear Gets a DateRange representing the preceding year from midnight to midnight in the current Offset using the current DateTimeFormat rule
Public propertyLower Gets or sets the lowest value in the range.
Public propertyStatic memberThisMonth Gets a DateRange representing the current month from midnight to midnight in the current Offset using the current DateTimeFormat rule
Public propertyStatic memberThisWeek Gets a DateRange representing the current week from midnight to midnight in the current Offset using the current DateTimeFormat rule
Public propertyStatic memberThisYear Gets a DateRange representing the current year from midnight to midnight in the current Offset using the current DateTimeFormat rule
Public propertyStatic memberThisYearToDate Gets a DateRange representing the current year through today's date from midnight to midnight in the current Offset using the current DateTimeFormat rule
Public propertyTimeSpan Gets the duration implied by the date range.
Public propertyStatic memberToday Gets a DateRange representing the current date from midnight to midnight in the current Offset
Public propertyUpper Gets or sets the highest value in the range.
Public propertyStatic memberYesterday Gets a DateRange representing the date before the current date from midnight to midnight in the current Offset
Top
Methods
 NameDescription
Public methodCode exampleCompareTo(DateRange) Compares the current instance with another DateRange.
Public methodCode exampleCompareTo(DateTimeOffset) Compares this instance to a specified DateTimeOffset structure and returns an indication of their relative values.
Public methodContains(DateTimeOffset) Returns true if the given DateTimeOffset is contained within this range.
Public methodContains(IRangeDateTimeOffset) Returns true if the given range is contained within this range.
Public methodContains(NullableDateRange) Returns true if the given DateRange is contained within this range.
Public methodEquals(DateRange) Determines whether the specified DateRange is equal to the current DateRange.
Public methodEquals(Object) Determines whether the specified Object is equal to the current DateRange.
(Overrides ValueTypeEquals(Object))
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCode Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
(Overrides ValueTypeGetHashCode)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodOverlaps(DateRange) Returns true if the given DateRange is partially contained within this DateRange.
Public methodOverlaps(IRangeDateTimeOffset) Returns true if the given range is partially contained within this range.
Public methodToOffset Converts the value of the current DateRange object to the date range specified by an offset value.
Public methodToString Converts the value of this instance to its equivalent string representation.
(Overrides ValueTypeToString)
Public methodToString(IFormatProvider) Converts the value of this instance to its equivalent string representation using the specified culture-specific format information.
Public methodToString(String) Converts the value of this instance to its equivalent string representation using the specified format.
Public methodToString(String, IFormatProvider) Converts the value of this instance to its equivalent string representation using the specified format and culture-specific format information.
Top
Operators
 NameDescription
Public operatorStatic memberEquality(DateRange, DateRange) Compares two instances of DateRange for equality.
Public operatorStatic memberGreaterThan(DateRange, DateRange) Determines whether one DateRange is greater than another.
Public operatorStatic memberInequality(DateRange, DateRange) Compares two instances of DateRange for inequality.
Public operatorStatic memberLessThan(DateRange, DateRange) Determines whether one DateRange is less than another.
Top
Fields
 NameDescription
Public fieldStatic memberSqlDateTimeValidRange Gets the minimum and maximum allowable values for the SQL datetime data type.
Public fieldStatic memberSqlSmallDateTimeValidRange Gets the minimum and maximum allowable values for the SQL smalldatetime data type.
Top
Explicit Interface Implementations
 NameDescription
Explicit interface implementationPrivate methodIComparableCompareTo Compares this instance to a specified Object and returns an indication of their relative values.
Top
See Also