Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 1.54 KB

File metadata and controls

41 lines (29 loc) · 1.54 KB
-api-id -api-type
T:Windows.ApplicationModel.Contacts.ContactDate
winrt class

Windows.ApplicationModel.Contacts.ContactDate

-description

Represents an important date for a contact.

-remarks

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

Insert 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.

Build 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.

-examples

-see-also

ImportantDates

-capabilities

contactsSystem