DatePickerFlyout.MonthFormat プロパティ

定義

月の値の表示形式を取得または設定します。

public:
 property Platform::String ^ MonthFormat { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring MonthFormat();

void MonthFormat(winrt::hstring value);
public string MonthFormat { get; set; }
var string = datePickerFlyout.monthFormat;
datePickerFlyout.monthFormat = string;
Public Property MonthFormat As String
<DatePickerFlyout MonthFormat="formatString"/>

プロパティ値

String

Platform::String

winrt::hstring

月の値の表示形式。

注釈

MonthFormat プロパティを設定して、月の値の書式を変更します。

月の値の文字列内容は、 DateTimeFormatter によって作成されます。 日付の値を書式設定する方法を DateTimeFormatter に通知するには、 書式テンプレート または 書式パターンのいずれかの文字列を指定します。 日の値の一般的なテンプレートとパターンを次の表に示します。

書式パターンテンプレートの書式設定
'{month.integer} |{month.integer(n)} ''month.numeric'
'{month.full} |{month.abbreviated} |{month.abbreviated(n)}''month |month.full |month.abbreviated'

場合によっては、書式パターンを使用すると、書式設定をより正確に制御できます。 たとえば、書式パターンを使用して、必要に応じて先頭に 0 を含む 2 桁の月の選択が常に表示されるように指定できます。 複数の書式パターンを組み合わせることもできます。 たとえば、 と {month.abbreviated} の形式を{month.integer}組み合わせて、月の選択ウィンドウに月の番号と名前を表示できます (たとえば、12 月 12 日)。詳細については、「例」セクションを参照してください。

書式テンプレートと書式パターンの完全な一覧については、 DateTimeFormatter クラスドキュメントの「解説」セクションを参照してください。

注意

日付ピッカーが小さな領域に表示される場合 (曜日の完全な文字列値を追加するなど) は、一部の日付形式を避ける必要があります。 これらの文字列は長くすることができ、DatePicker の幅が強制的に小さい場合はクリップされる可能性があります。

適用対象

こちらもご覧ください