Versions Compared

Key

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

Table of Contents

Description

Range The range picker allows the user to set a customized range of dates using a unified component.

Range The range picker’s structure and behavior are based on the Date Picker, and are therefore are not repeated here.

...

General guidelines

Structure

Range The range picker consists of:

  • A The range picker field, with two date inputs:

    • From date. The start of the range.

    • To date. The end of the range.

  • Date The date picker button. A calendar Icon Button which opens a the drop-down menu.

  • Preceding label (optional).

  • A drop-down range picker menu, which consists of:

    • Range picker menu, with a month Month and year pickers for each half of the calendar.

    • Two - month calendars.

Component

Image

Comments

Range picker field

A string indicating the range (From - To) and an icon button.

Next to the field, a preceding label can be set describing the purpose of the control.

Range picker menu

2 month calendars, displayed horizontally from left (start) to right (end). The direction of the dates might change according to RTL languages.

...

  • The months displayed in the menu can be changed independently.

  • The user cannot select a To (end) date which is earlier than the selected From (start) date, or a From (start) date which is later than the selected To (end) date.

  • The range picker field will be updated in response to selections made in the range picker menu.

  • When 2 consecutive months are displayed together on the menu, the arrows are disabled accordingly, so that the From month cannot be moved forward and the To month cannot be moved backward:

  • DropOptions should be disabled in the month and year drop-down selectors for months and years should be disabled to prevent a From date which is later than the To date.

  • The two date inputs in the range picker field can always be directly edited, with no need to use the range picker menu.

  • Clicking either the From or To fields or the date picker icon will open the range picker menu with the relevant date selected (either From or To).

    • Clicking the date picker icon is equivalent to clicking on the From date.

Interaction

Happy flow

1. Clicking on the From field.

Opens the The menu is opened:

  • By default, the From field The From text is highlighted in the calendar (if exist), and the From text selected in the range picker fieldrange picker field.

  • If one is already set, the From date is highlighted on the calendar.

  • Clicking outside of the control is equivalent to the Cancel operation (closes the dropdown Cancel: the drop-down closes without applying any change)changes.

2. Selecting the From date.

  • The selected date is indicated on the calendar and in the range picker field.

  • The focus highlight automatically moves to the To field.

  • Clicking outside the menu is equivalent to the Cancel operationcloses the drop-down without applying any changes.

  • As the user hovers over another date, the dates between it and the selected From date should be highlighted. (The hover state is displayed only if the hovered date is later than the currently selected From date

or range
  • ).

3. Selecting the To date

  • Clicking on a date which is later than or the same or later than as the From date will:

    • close the calendar drop-down will close.

    • update the range picker field dates will be updated accordingly.

...

  • Directly editing an existing range.

  • Clicking on either

a
  • the From or To

field
  • fields will:

    • select the date within the

fields and
    • range picker field.

    • open the drop-down menu with the date highlighted.

Additional case

...

  • Selecting a date that is earlier than the

...

  • selected From date

...

  • .

  • The From field will

update
  • be updated to the new date.

  • The To field will reset.

Validations and errors

Validation is displayed on across the entire component.

Error

In the example, the From date is later than the To date (manually entered).

Warning

...

The Range picker menu should slide up and down and selecting .

Selecting the right and left arrows should swipe the dates horizontally the dates, see . See the Date Picker for an example.

A swipe transition is used when pressing the left and right arrows to navigate between the months, as shown in the Date Picker.

Best practices

Use:

  • whenever a user is required to set a custom period.

Don’t use:

  • when a default set of ranges is pre-defined → a Selector can be a better approach for offering different periods.

...

  • If start and end times are also required, use the Time Picker component adjacent to the range picker. Example:

Accessibility compliance

...