--- title: timepicker slug: Archive/Mozilla/XUL/timepicker tags: - XUL Elements - XUL Reference translation_of: Archive/Mozilla/XUL/timepicker ---
timepicker は時間の入力に使われます。時、分、秒の 3 つのフィールドを持っています。フィールドの隣の矢印ボタンはマウスによる値の調整を可能にしています。4 つ目のテキストボックスは 12 時間表記で午前か午後かを選べるように出現します。
初期値を指定するには、value 属性に HH:MM:SS あるいは HH:MM のどちらかの値を設定します。value プロパティか dateValue プロパティを使用して値を取得したり変更できます。前者は時間を HH:MM:SS 形式の文字列として指定し、一方後者は時間を Date オブジェクトとして指定します。さらに、hour, minute, second プロパティで時間の各要素の取得と変更ができます。
時間が変更されるたびに change イベントが発生します。However, as described in Mozilla bug #799219, a change event handler may encounter erratic behavior when the time is changed using the keyboard instead of the mouse. To avoid this, you can use the workaround described here, i.e., use window.setTimeout(actual-event-handler-function, 0); to queue up your event handler to run after the rest of the picker's change event handlers.
<timepicker value="12:05"/>

disabledtrue に設定されていたら、その要素は無効化されています。無効化された要素は通常グレイ表示のテキストで描画されます。要素が無効化されていると、ユーザのアクションには応答せず、フォーカスもあてられず、command イベントも発生しません。
hidesecondsreadonlytrue に設定した場合、ユーザは要素の値を変更できません。しかし、スクリプトからは依然として値を変更できます。readonly 属性は XBL フィールド上で正しく動作しませんでした。incrementhideseconds が true に設定されている必要があります。tabindex tab キーが押下されたときにフォーカスが移動する順番です。より大きな tabindex の値をもつ要素は、タブの遷移が後になります。 value
amIndicator AM です。この値はユーザが使用するロケールに合わせる事もできます。 hideSecondshourhourLeadingZerois24HourClockisPMfalse の場合、hour は 0 から 11 の間になります。true の場合、hour は 12 以上になります。minuteminuteLeadingZeropmIndicatorreadOnlytrue に設定すると、ユーザは要素の値を変更できなくなります。secondsecondLeadingZerovalueXUL 要素からの継承
blur, click, doCommand, focus, getElementsByAttribute, getElementsByAttributeNS
DOM 要素からの継承
addEventListener(), appendChild(), compareDocumentPosition, dispatchEvent(), getAttribute(), getAttributeNode(), getAttributeNodeNS(), getAttributeNS(), getElementsByTagName(), getElementsByTagNameNS(), getFeature, getUserData, hasAttribute(), hasAttributeNS(), hasAttributes(), hasChildNodes(), insertBefore(), isEqualNode, isSameNode, isSupported(), lookupNamespaceURI, lookupPrefix, normalize(), removeAttribute(), removeAttributeNode(), removeAttributeNS(), removeChild(), removeEventListener(), replaceChild(), setAttribute(), setAttributeNode(), setAttributeNodeNS(), setAttributeNS(), setUserData
nsIDOMXULControlElement