ContactDate class

Applies to Windows and Windows Phone

Represents an important date for a contact.

Syntax


var contactDate = new Windows.ApplicationModel.Contacts.ContactDate();

Attributes

[MarshalingBehavior(Agile)]
[Version(0x06030000)]

Members

The ContactDate class has these types of members:

Constructors

The ContactDate class has these constructors.

ConstructorDescription
ContactDate Initializes a new instance of a ContactDate class.

 

Properties

The ContactDate class has these properties.

PropertyAccess typeDescription

Day

Read/writeGets and sets the day for an important date for a contact.

Description

Read/writeGets and sets the description for an important date for a contact. The maximum string length for the description is 512 characters.

Kind

Read/writeGets and sets the kind of important date for a contact.

Month

Read/writeGets and sets the month for an important date for a contact.

Year

Read/writeGets and sets the year for an important date for a contact.

 

Remarks

Here is how to use the ContactDate properties to format date strings.

Dn297434.wedge(en-us,WIN.10).gifInsert sentinel values

  1. Construct a Windows.Globalization.Calendar.
  2. If year has a value, set year to that value, else set year to 2004 (a leap year so every day is valid).
  3. If month has a value, set month to that value, else set month to 1 (a month with every day valid).
  4. if day has a value, set day to that value (day will be set to some value automatically and we don't really care what it is so no need to explicitly set it).
  5. Get the Windows.Foundation.DateTime from the Calendar.

Dn297434.wedge(en-us,WIN.10).gifBuild up a template to format

  1. If year has a value, append "year " to the template.
  2. If month has a value, append "month " to the template.
  3. If day has a value, append "day " to the template.
  4. Construct a Windows.Globalization.DateTimeFormatting.DateTimeFormatter with the template.
  5. Format by using the date time formatter and the Windows.Foundation.DateTime retrieved from the Calendar.

Requirements

Minimum supported client

Windows 8.1 [Windows Store apps only]

Minimum supported server

Windows Server 2012 R2 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.ApplicationModel.Contacts
Windows::ApplicationModel::Contacts [C++]

Metadata

Windows.winmd

See also

ImportantDates
Object

 

 

Show:
© 2014 Microsoft