DatePickerFlyout.DayFormat Property
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.
Gets or sets the display format for the day value.
public:
property Platform::String ^ DayFormat { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring DayFormat();
void DayFormat(winrt::hstring value);
public string DayFormat { get; set; }
var string = datePickerFlyout.dayFormat;
datePickerFlyout.dayFormat = string;
Public Property DayFormat As String
<DatePickerFlyout DayFormat="formatString"/>
Property Value
The display format for the day value.
Remarks
Change the format of the day value by setting the DayFormat property.
The string content of the day value is created by a DateTimeFormatter. You inform the DateTimeFormatter how to format the day value by providing a string that is either a format template or a format pattern. Common templates and patterns for day values are listed in the following table.
format pattern | format template |
---|---|
`{day.integer} | {day.integer(n)}` | `day` |
`{dayofweek.full} | {dayofweek.abbreviated} | {dayofweek.abbreviated(n)}` | `dayofweek | dayofweek.full | dayofweek.abbreviated` |
In some cases, using a format pattern gives you more precise control over the formatting. For example, you can use a format pattern to specify that the day picker always shows 2 digits, including a leading 0 when needed. You can also combine multiple format patterns. For example, you can combine the {day}
and {dayofweek.abbreviated}
formats to make the day picker show both the numeric date and the day of the week, like this: 14 Thu. See the Examples section for more info.
For the complete list of format templates and format patterns, see the Remarks section of the DateTimeFormatter class documentation.
Note
Some date formats should be avoided if the date picker might be displayed in a small area, such as adding the full string value of the day of week. These strings can be long and might be clipped if the DatePicker's width is forced to be small.