Show / Hide Table of Contents

Class Date

Represents a single date. Dates may be represented at different levels of precision, for example, date and time, date only, month + year only, year only, etc.

Inheritance
System.Object
NotificationObject
Date
Inherited Members
NotificationObject.PropertyChanged
NotificationObject.RaisePropertyChanged(String)
NotificationObject.RaisePropertyChanged(String[])
Algenta.Colectica.Model.NotificationObject.RaisePropertyChanged<T>(Expression<>)
NotificationObject.OnPropertyChanged(String)
NotificationObject.ResumePropertyEvents()
NotificationObject.SuspendPropertyEvents()
NotificationObject.PropertyEventsSuspended
NotificationObject.PropagateChildChanges(INotifyCollectionChanged, String)
Namespace: Algenta.Colectica.Model.Ddi
Assembly: Algenta.Colectica.Model.Ddi.dll
Syntax
public class Date : NotificationObject

Properties

DateOnly

For Dates with Date precision, gets or sets the date.

Declaration
public DateTime? DateOnly { get; set; }
Property Value
Type Description
System.Nullable<DateTime>

The date only.

DateTime

For Dates with DateTime precision, gets or sets the date and time.

Declaration
public DateTime? DateTime { get; set; }
Property Value
Type Description
System.Nullable<DateTime>

The date and time.

DateTimeTypes

Gets a collection of the supported precisions.

Declaration
public static Array DateTimeTypes { get; }
Property Value
Type Description
Array

HasValue

Gets a value indicating whether this instance has any content.

Declaration
public bool HasValue { get; }
Property Value
Type Description
System.Boolean

true if this instance has any content; otherwise, false.

Month

For Dates with YearMonth precision, gets or sets the month.

Declaration
public int ? Month { get; set; }
Property Value
Type Description
System.Nullable<System.Int32>

The month.

Precision

Gets or sets the precision held by this instance.

Declaration
public DatePrecisionType Precision { get; set; }
Property Value
Type Description
DatePrecisionType

The precision.

StringValue

Gets or sets the string representation of a Date.

Declaration
public string StringValue { get; set; }
Property Value
Type Description
System.String

The string value.

Remarks

The setter attempts to parse the following formats

  • Year-month (e.g., "2011-07")
  • Year (e.g., "2011")
  • Formats supported by

Year

For Dates with YearMonth or Year precision, gets or sets the year.

Declaration
public int ? Year { get; set; }
Property Value
Type Description
System.Nullable<System.Int32>

The year.

Methods

SetDate(DateTime)

Sets the date.

Declaration
public void SetDate(DateTime date)
Parameters
Type Name Description
DateTime date

The date.

SetDateTime(DateTime)

Sets the date and time.

Declaration
public void SetDateTime(DateTime dateTime)
Parameters
Type Name Description
DateTime dateTime

The date time.

SetYear(Int32)

Sets the year.

Declaration
public void SetYear(int year)
Parameters
Type Name Description
System.Int32 year

The year.

SetYearMonth(Int32, Int32)

Sets the year and month.

Declaration
public void SetYearMonth(int year, int month)
Parameters
Type Name Description
System.Int32 year

The year.

System.Int32 month

The month.

ToString()

Returns a that represents this instance.

Declaration
public override string ToString()
Returns
Type Description
System.String

A that represents this instance.

Extension Methods

Extensions.Yield<T>(T)
Back to top Copyright © 2009-2018 Colectica