ContactDate class

ContactDate class

Represents an important date for a contact.

Syntax


public ref class ContactDate sealed 

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/write

Gets and sets the day for an important date for a contact.

Description

Read/write

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

Kind

Read/write

Gets and sets the kind of important date for a contact.

Month

Read/write

Gets and sets the month for an important date for a contact.

Year

Read/write

Gets and sets the year for an important date for a contact. This value must be convertible to a FILETIME structure.

 

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 (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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

Attributes

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

See also

ImportantDates
Object

 

 

Show:
© 2017 Microsoft