Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Two time pickers can be used, for start and end times, to allow the user to enter a time range.

...

Usage & Behavior

General guidelines

...

The time picker may have an initial value, which the user can edit at any time.

States

State

Visual

 

Regular

Image Removed
Time Picker - Regular.pngImage Added

 

Hover

Time Picker - Hover.pngImage Added
Image Removed

 

Active

Image RemovedImage Removed
Time Picker -  Active AM.pngImage AddedTime Picker - Active minutes and seconds only.pngImage AddedTime Picker -  Active PM.pngImage Added

Time Picker - Active with seconds.pngImage Added

Disabled

Image Removed

Time Picker - Disabled.pngImage Added

 

Read-Only

Time Picker - Read only.pngImage Added

Error

Time Picker - Error.pngImage Added
Image Removed

 

Warning

Time Picker - Warning.pngImage Added
Image Removed

 

Focused

Time Picker - Focused.pngImage AddedTime Picker - Focused minutes.pngImage Added
Image Removed
Time Picker - Focused seconds.pngImage Added
Image Removed
Time picker - Focused AMPM.pngImage Added

Focused, Hover

Time Picker - Focused Hover.pngImage Added
Image Removed

 

Focused, Active

Time Picker - Focused Active.pngImage Added
Image Removed

 

Focused, Disabled

Image Removed
Time Picker - Focused, Disabled.pngImage Added

 

Interaction

The time can be set either via direct input or by using the controls in the time picker drop-downmenu. Additional keyboard interactions can be found under the Focus management section below.

Direct input

  • Allow the user to The time picker can have an initial value, which the user can edit at any time.

  • When clicking the text, the relevant input section will be highlighted (HH, MM, or AM/PM.).
    For example:
    Time Picker - Active collapsed.pngImage Added

    • When HH or MM are highlighted, only numerical value inputs will be permitted.

  • When AM/PM is clicked on, it will toggle between the two options.

  • Once an input section has been filled, the highlight will move to the next section.

  • On Apply, the time picker field will lose focus (nothing is highlighted).

  • The user should be allowed to enter times in loose formats, which where possible. These should be automatically corrected when the field is out of loses focus. For example:

    • 5 :08 becomes 05:08

    • 508 becomes 05:08

    • When the user’s should be auto-corrected to 05.

    • when the time format is set to 12 hours, 15:08 becomes auto-corrects to 03:08 PM.

  • If the drop-down is opened, hitting Enter will close it.

Using the controls

Time picker menu

  • Clicking on the clock Icon Button or any blank space will open the time picker drop-downmenu.

  • Clicking the hours or minutes will change them into a Text Field, where the user can directly type the required value. When the input field loses focus, the time will be updated in the top input field accordingly.

  • Clicking outside the picker drop-down or hitting Enter will close it with updated input.

  • Clicking on the up and down arrows will increase or decrease the hours or minutes accordingly.
    Alternatively, the user can use the mouse wheel to increase or decrease the values, as long as the corresponding control is selected.

  • The iteration is The time picker menu will be closed:

    • when a time is applied, or

    • by clicking outside of the time picker menu.

  • The time inputs are cyclical:

    • When the hours are hour is set to 12 (in 12 hour time format) and , the up arrow is clicked, loops the value loops back to 101.

    • When the hours are hour is set to 23 (in 24 hour time format) and , the up arrow is clicked, loops the value loops back to 000.

    • When the minutes are set to 00 and , the down arrow is clicked, changes the value changes to 59.

    Clicking the
    • When the minutes are set to 59, the up arrow changes the value to 00.

  • For AM/PM icon toggles between the 2 options, the arrows are not cyclical. Up arrow will change to PM and Down arrow to AM.

  • Changing values the time in the drop-down will also update the values in the top input field accordingly.

...

  • menu should immediately sync the direct input displayed time

Validation and Errors

Please refer to Field validation page for more information.

A time field with a warning will have an orange border and a warning icon, as displayed below: 

...

A time field with an error will have a red border and an error icon, as displayed below:

...

Best practices

Use when:

  • You want the user to select or set a time.

  • You want the user to select a time range. In this case, one time picker can be used to set the start time and a second one to set the end time.

...

Unless otherwise specified, see our general compliance information in Fundamentals - Accessibility.

Focus management

Keyboard

Time picker field

Time picker menu

Time Picker - Focused.pngImage AddedTime Picker - Focused minutes.pngImage Added

Tab

  • Navigates to the next input section.

  • When on the last input section, navigates to the next component.

Navigates between the different sections in a cyclical order:

  • Hours.

  • Minutes.

  • AM/PM.

Shift + Tab

  • Navigates to the previous input section.

  • When on the first input section, navigates to the previous component.

Reverses the order of navigation described for Tab.

Space

Opens the time picker menu.

  • Hours - N/A

  • Minutes - N/A

  • AM/PM - toggles between the values.

Enter

Applies the time.

  • Applies the time.

  • Closes the menu.

Esc

N/A

Closes the menu and returns the focus to the field, without applying any changes.

Arrows

  • Up - Increases the highlighted value.

  • Down - Decreases the highlighted value.

  • Holding down the up/down keys will scroll continuously.

  • Right/Left - Moves the input highlight accordingly.

  • Up - Increases the highlighted value for the focused section.

  • Down - Decreases the highlighted value for the focused section.

  • Holding down the up/down keys will scroll continuously.

  • Right/Left - Moves the focused section accordingly.

  • Up/Down changes between AM/PM

Mouse

Time picker field

Time picker menu

Right Click

Set Focus state on field

Set Regular state on component

Design

Zeplin Link

Thumbnail

https://zpl.io/adOXdRV

Image Removed
Time picker states.pngImage Added

Code

...