behavior: time

behavior: time

time input element.

Elements

that have this behavior applied by default:

  • <input type="time" /> – inline input input element

Model

Upon initialization the behavior creates following DOM structure:

<input>
  <caption>
    <span.hour>
    <span.minute>
    <span.second>
    <span.ampm>
  </caption>
  <button.plus>
  <button.minus>
</input>

<span.ampm> is optional – it appears only if current locale (lang) requires it.

<caption> has have behavior:masked applied. <button.plus> and <button.minus> trigger increment/decrement of current sub-field.

Attributes

that this behavior knows about:

  • value="HH:MM:SS" – time, initial value of the input element. Time portion of ISO 8601 format.
  • timezone="TZ" – timezone to show the time for. TZ can be either "local" or "+HH:MM" / "-HH:MM".

Events

Aside of standard set of events (mouse, keyboard, focus) behavior: button generates:

  • EDIT_VALUE_CHANGED event – value of the element (time) was changed due to user actions. Posted (asynchronous) event.

Value

Date value or undefined, reflects current status of internal editing buffer. Only time portion of the date object is relevant. The date value is always UTC.

Methods

N/A – this input element has no specific methods but <caption> sub-element has behavior:masked specific methods.