ContactDate Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents an important date for a contact.
public ref class ContactDate sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class ContactDate final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class ContactDate final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class ContactDate
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class ContactDate
function ContactDate()
Public NotInheritable Class ContactDate
- Inheritance
- Attributes
Windows requirements
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
App capabilities |
contactsSystem
|
Remarks
Here is how to use the ContactDate properties to format date strings.
Insert sentinel values
- 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.
Build up a template to format
- 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.
Constructors
ContactDate() |
Initializes a new instance of a ContactDate class. |
Properties
Day |
Gets or sets the day for an important date for a contact. |
Description |
Gets or sets the description for an important date for a contact. The maximum string length for the description is 512 characters. |
Kind |
Gets or sets the kind of important date for a contact. |
Month |
Gets or sets the month for an important date for a contact. |
Year |
Gets or sets the year for an important date for a contact. This value must be convertible to a FILETIME structure. |