Show / Hide Table of Contents

Struct DateOffset

A relative date specified by a magnitude and offset

Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public struct DateOffset : IComparable<DateOffset>, IComparable

Constructors

| Improve this Doc View Source

DateOffset(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 Source

FirstDayOfWeek

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

| Improve this Doc View Source

Magnitude

Magnitude of the offset (e.g. days, weeks, months, etc).

Declaration
public DateMagnitude Magnitude { get; }
Property Value
Type Description
DateMagnitude
| Improve this Doc View Source

Offset

The amount of time units to offset

Declaration
public int Offset { get; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

AsDate(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
| Improve this Doc View Source

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 other in the sort order. Zero This instance occurs in the same position in the sort order as other. Greater than zero This instance follows other in the sort order.

Implements
System.IComparable<T>.CompareTo(T)
| Improve this Doc View Source

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 obj in the sort order. Zero This instance occurs in the same position in the sort order as obj. Greater than zero This instance follows obj in the sort order.

Implements
System.IComparable.CompareTo(System.Object)
Exceptions
Type Condition
System.NotSupportedException

If obj is not of type DateOffset

  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX