DatePickerFlyout.MonthFormat DatePickerFlyout.MonthFormat DatePickerFlyout.MonthFormat DatePickerFlyout.MonthFormat Property


Gets or sets the display format for the month value.

public : Platform::String MonthFormat { get; set; }
winrt::hstring MonthFormat();

void MonthFormat(winrt::hstring monthformat);
public string MonthFormat { get; set; }
Public ReadWrite Property MonthFormat As string
<DatePickerFlyout MonthFormat="formatString"/>

Property Value

string string

The display format for the month value.


Change the format of the month value by setting the MonthFormat property.

The string content of the month 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 patternformat template
`{month.integer} | {month.integer(n)} ``month.numeric`
`{month.full} | {month.abbreviated} | {month.abbreviated(n)}``month | month.full | month.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 month picker always shows 2 digits, including a leading 0 when needed. You can also combine multiple format patterns. For example, you can combine the {month.integer} and {month.abbreviated} formats to make the month picker show the month number and name, like this: 12 Dec. 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.


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.

See also