ContactDate
ContactDate
ContactDate
ContactDate
Class
Definition
Represents an important date for a contact.
public : sealed class ContactDate : IContactDatepublic sealed class ContactDate : IContactDatePublic NotInheritable Class ContactDate Implements IContactDate// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
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() ContactDate() ContactDate() ContactDate()
Initializes a new instance of a ContactDate class.
public : ContactDate()public ContactDate()Public Sub New()// You can use this method in JavaScript.
Properties
Day Day Day Day
Gets and sets the day for an important date for a contact.
public : IReference<uint> Day { get; set; }public Nullable<uint> Day { get; set; }Public ReadWrite Property Day As Nullable<uint>// You can use this property in JavaScript.
- Value
- IReference<unsigned int> Nullable<uint> Nullable<uint> Nullable<uint>
The day for an important date for a contact.
Description Description Description Description
Gets and sets the description for an important date for a contact. The maximum string length for the description is 512 characters.
public : PlatForm::String Description { get; set; }public string Description { get; set; }Public ReadWrite Property Description As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The description for an important date for a contact.
Kind Kind Kind Kind
Gets and sets the kind of important date for a contact.
public : ContactDateKind Kind { get; set; }public ContactDateKind Kind { get; set; }Public ReadWrite Property Kind As ContactDateKind// You can use this property in JavaScript.
A ContactDateKind -typed value that indicates the type of important date for a contact.
Month Month Month Month
Gets and sets the month for an important date for a contact.
public : IReference<uint> Month { get; set; }public Nullable<uint> Month { get; set; }Public ReadWrite Property Month As Nullable<uint>// You can use this property in JavaScript.
- Value
- IReference<unsigned int> Nullable<uint> Nullable<uint> Nullable<uint>
The month for an important date for a contact.
Year Year Year Year
Gets and sets the year for an important date for a contact. This value must be convertible to a FILETIME structure.
public : IReference<int> Year { get; set; }public Nullable<int> Year { get; set; }Public ReadWrite Property Year As Nullable<int>// You can use this property in JavaScript.
- Value
- IReference<int> Nullable<int> Nullable<int> Nullable<int>
The year for an important date for a contact.