TimePicker.hourPattern property

Gets or sets the display pattern for the hour.

The default hour pattern is hour.integer(2). You can change the hour pattern by changing the number of integers displayed.

Syntax

<div data-win-control="WinJS.UI.TimePicker" data-win-options="{ hourPattern : value}" />
var hourPattern = timePicker.hourPattern;
timePicker.hourPattern = hourPattern;

Property value

Type: String

The display pattern for the hour.

The following list gives the possible values for the patterns you can use in a TimePicker:

  • {hour.abbreviated} | {hour.abbreviated(n)}
  • {hour.integer} | {hour.integer(n)}

Examples

The following code shows how to set an hour pattern.

timePicker.hourPattern = "{hour.abbreviated(4)}";

Requirements

Minimum WinJS version

WinJS 1.0

Namespace

WinJS.UI

See also

TimePicker