XUL:timepicker
From MDC
This article covers features introduced in Firefox 3
« XUL Reference home [ Examples | Attributes | Properties | Methods | Related ]
The timepicker is used to allow the user to enter a time. It contains three fields to enter the hour, minute and second. Arrow buttons next to the fields allow the values to be adjusted with the mouse. A fourth textbox appears for 12 hour clocks which allows selection of AM or PM.
To specify the initial, use the value attribute set to a value of either the form HH:MM:SS or HH:MM. The value may be retrieved and changed using the value property or the dateValue property. The former specifies the time as a string of the form HH:MM:SS whereas the latter specifies the time as a Date object. In addition, the hour, minute and second properties may be used to retrieve and modify each component of the time separately.
- Properties
- amIndicator, dateValue, disabled, hideSeconds, hour, hourLeadingZero, increment, is24HourClock, isPM, minute, minuteLeadingZero, pmIndicator, readOnly, second, secondLeadingZero, tabIndex, value
[edit] Examples
<timepicker value="12:05"/>
[edit] Attributes
|
Inherited from XUL element |
- disabled
- Type: boolean
- Indicates whether the element is disabled or not. If this element is set to
truethe element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and thecommandevent will not fire.
- hideseconds
- Type: boolean
- Indicates whether to show the seconds field.
- readonly
- Type: boolean
- If set to
true, then the user cannot change the value of the element. However, the value may still be modified by a script.
- increment
- Type: integer
- Indicates the number of minutes to skip each time the arrows are pressed. This should be used in combination with setting hideseconds to
true.
- tabindex
- Type: integer
- The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher
tabindexare later in the tab sequence.
- value
- Type: string
- The initial value of the timepicker in either the form HH:MM:SS or HH:MM.
[edit] Properties
|
Inherited from XUL element Inherited from DOM element |
- amIndicator
- Type: string
- The string value displayed for hours between midnight and noon, defaulting to AM. This value is determined from the user's locale.
- dateValue
- Type: Date
- The date that is currently entered or selected in the datepicker as a Date object.
- hideSeconds
- Type: boolean
- Indicates whether the seconds field is visible or not.
- hour
- Type: integer
- The currently selected hour from 0 to 23. Set this property to change the selected hour.
- hourLeadingZero
- Type: boolean
- A read only value indicating whether a leading zero should be displayed before the hour when it is less than 10.
- is24HourClock
- Type: boolean
- A read only value indicating whether a 12-hour or 24-hour clock is used to display times. With a 12-hour clock, an extra field allows the user to pick between AM and PM. This value is determined from the user's locale.
- isPM
- Type: boolean
- If false, the hour is between 0 and 11, and if true, the hour is 12 or greater.
- minute
- Type: integer
- The currently selected minute from 0 to 59. Set this property to change the selected minute.
- minuteLeadingZero
- Type: boolean
- A read only value indicating whether a leading zero should be displayed before the minute when it is less than 10.
- pmIndicator
- Type: string
- The string value displayed for hours between noon and midnight, defaulting to PM. This value is determined from the user's locale.
- readOnly
- Type: boolean
- If set to
true, then the user cannot modify the value of the element.
- second
- Type: integer
- The currently selected second from 0 to 59. Set this property to change the selected second.
- secondLeadingZero
- Type: boolean
- A read only value indicating whether a leading zero should be displayed before the second when it is less than 10.
- value
- Type: string
- The currently entered time of the form HH:MM:SS. Set this property to change the time.
[edit] Methods
|
Inherited from XUL element Inherited from DOM element |
[edit] Related
- Interfaces
- nsIDOMXULControlElement