Struct DateOffset
A relative date specified by a magnitude and offset
Inherited Members
Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public struct DateOffset : IComparable<DateOffset>, IComparable
Constructors
| Improve this Doc View SourceDateOffset(Int16, DateMagnitude)
Initializes a structure to represent a relative date specified by a magnitude and offset
Declaration
public DateOffset(short offset, DateMagnitude magnitude)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | offset | The amount of time units to offset. |
DateMagnitude | magnitude | The magnitude of the offset (e.g. days, weeks, months, etc). |
Properties
| Improve this Doc View SourceFirstDayOfWeek
First day of the week to use for week offset calculations
Declaration
public DayOfWeek FirstDayOfWeek { get; set; }
Property Value
Type | Description |
---|---|
System.DayOfWeek | The first day of week. Defaults to System.DayOfWeek.Sunday |
Magnitude
Magnitude of the offset (e.g. days, weeks, months, etc).
Declaration
public DateMagnitude Magnitude { get; }
Property Value
Type | Description |
---|---|
DateMagnitude |
Offset
The amount of time units to offset
Declaration
public int Offset { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceAsDate(DateTimeOffset, Boolean)
Convert the date offset to an actual date relative to today
Declaration
public DateTime AsDate(DateTimeOffset todaysDate, bool isEndDate = false)
Parameters
Type | Name | Description |
---|---|---|
System.DateTimeOffset | todaysDate | This should be expressed in the local timezone |
System.Boolean | isEndDate | Indicates whether this date be used as the end date of an inclusive range |
Returns
Type | Description |
---|---|
System.DateTime |
CompareTo(DateOffset)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Declaration
public int CompareTo(DateOffset other)
Parameters
Type | Name | Description |
---|---|---|
DateOffset | other | An object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Int32 | A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes |
Implements
CompareTo(Object)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Declaration
public int CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | An object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Int32 | A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes |
Implements
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | If |