Struct DateRange
Data structure that represents a range of dates.
Implements
Inherited Members
Namespace: Unity.AppUI.Core
Assembly: Unity.AppUI.dll
Syntax
[Serializable]
public struct DateRange : IEquatable<DateRange>
Constructors
DateRange(DateTime, DateTime)
Declaration
public DateRange(DateTime start, DateTime end)
Parameters
DateRange(Date, Date)
Constructs a Date
Declaration
public DateRange(Date start, Date end)
Parameters
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the start date is greater than the end date. |
Properties
end
The end date of the range.
Declaration
public Date end { get; }
Property Value
Type | Description |
---|---|
Date |
start
The start date of the range.
Declaration
public Date start { get; }
Property Value
Type | Description |
---|---|
Date |
Methods
Contains(Date, bool)
Determines whether the range contains a date.
Declaration
public bool Contains(Date date, bool includeStartAndEnd = true)
Parameters
Type | Name | Description |
---|---|---|
Date | date | The date to check. |
bool | includeStartAndEnd | Whether to include the start and end dates. |
Returns
Type | Description |
---|---|
bool | Whether the range contains the date. |
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool | Whether the specified object is equal to the current object. |
Overrides
Equals(DateRange)
Determines whether the specified object is equal to the current object.
Declaration
public bool Equals(DateRange other)
Parameters
Type | Name | Description |
---|---|---|
Date |
other | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool | Whether the specified object is equal to the current object. |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current object. |
Overrides
ToString()
Returns a string that represents the current Date
Declaration
public override string ToString()
Returns
Overrides
TryParse(string, out DateRange)
Try to parse a string into a Date
Declaration
public static bool TryParse(string value, out DateRange dateRange)
Parameters
Returns
Type | Description |
---|---|
bool | Whether the string was successfully parsed. |
Operators
operator ==(DateRange, DateRange)
Determines whether two Date
Declaration
public static bool operator ==(DateRange left, DateRange right)
Parameters
Type | Name | Description |
---|---|---|
Date |
left | The first Date |
Date |
right | The second Date |
Returns
operator !=(DateRange, DateRange)
Determines whether two Date
Declaration
public static bool operator !=(DateRange left, DateRange right)
Parameters
Type | Name | Description |
---|---|---|
Date |
left | The first Date |
Date |
right | The second Date |