-api-id | -api-type |
---|---|
T:Windows.ApplicationModel.Contacts.ContactDate |
winrt class |
Represents an important date for a contact.
Here is how to use the ContactDate properties to format date strings.
- Construct a Windows.Globalization.Calendar.
- If year has a value, set year to that value, else set year to 2004 (a leap year so every day is valid).
- If month has a value, set month to that value, else set month to 1 (a month with every day valid).
- 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).
- Get the Windows.Foundation.DateTime from the Calendar.
- If year has a value, append "year " to the template.
- If month has a value, append "month " to the template.
- If day has a value, append "day " to the template.
- Construct a Windows.Globalization.DateTimeFormatting.DateTimeFormatter with the template.
- Format by using the date time formatter and the Windows.Foundation.DateTime retrieved from the Calendar.
contactsSystem