DatePicker.yearPattern property

Gets or sets the display pattern for the year.

Syntax

<div data-win-control="WinJS.UI.DatePicker" data-win-options="{ yearPattern : value}" />
var yearPattern = datePicker.yearPattern;
datePicker.yearPattern = yearPattern;

Property value

Type: String

The display pattern for the year. The default year pattern is year.full. You can change the year pattern to the following values:

year.abbreviated(n)

You can use abbreviated with or without specifying the number of letters in the abbreviation.

Examples

The following code shows how to set a year pattern.

datePicker.yearPattern = "{year.abbreviated(2)}";

Requirements

Minimum WinJS version

WinJS 1.0

Namespace

WinJS.UI

See also

DatePicker