Date Time Picker
- Common Input Field Features
- Step
- Auto Open
- Validation
- Week Numbers
- Initial Position
- Usage Patterns
- Best Practises
- Related Components
Date Time Picker is an input field for selecting both a date and a time.
The date and time can be entered directly using a keyboard in the format of the current locale or through the Date Time Picker’s two overlays. The overlays open when their respective fields are clicked or any input is entered when the fields are focused.
Common Input Field Features
Date Time Picker includes all Text Field and shared input field features.
Step
Date Time Picker’s step parameter defines the time interval (in seconds) between the items displayed in the time picker overlay. It also specifies the amount by which the time increases/decreases using the Up/Down arrow keys (when the overlays are disabled).
The default step is one hour (that is 3600
).
Note that, unlike with Number Field, Date Time Picker accepts values that do not align with the specified step.
Note
|
Use even steps
The step must divide an hour or day evenly.
For example, "15 minutes", "30 minutes" and "2 hours" are valid steps, while "42 minutes" is not.
|
The displayed time format changes based on the step.
Step | Format |
---|---|
Less than 60 seconds | HH:MM:SS |
Less than 1 second | HH:MM:SS:FFF |
Note
|
Limit the number of steps
The overlay does not appear for steps less than 900 seconds (15 minutes) to avoid showing an impractical number of choices.
|
Auto Open
The overlay opens automatically when the field is focused using a pointer (mouse or touch), or when the user types in the field. You can disable that to only open the overlay when the toggle button or Up/Down arrow keys are pressed.
Validation
Week Numbers
You can configure Date Time Picker to show week numbers in the date picker overlay.
The week numbers are displayed according to ISO-8601. Please note that they can only be displayed when the first day of the week is Monday.
Initial Position
Date Time Picker’s initial position parameter defines which date is focused in the calendar overlay when the overlay is opened. Use this feature to minimise the need for any additional navigation and/or scrolling when the user’s input is expected to be within a certain time frame.
Usage Patterns
Best Practises
Use Date Time Picker when the user needs to choose both a date and time of day. If you only need a date or time of day, use Date Picker and Time Picker respectively.
Picking vs Typing
The calendar overlay is useful when the users need to choose a day that is close to the current date or when information such as day of the week, week number, and valid dates, etc. can aid in choosing the best option.
For days well in the past or future, and for known dates such as birthdays, typing the date can be the faster and easier approach. It is important to verify that the user can enter dates according to their locale.
Input Format
Use a placeholder or helper to show how the input should be formatted. This is important for the date picker if the overlay is disabled and/or when supporting multiple locales. For example, 12/6/2020 does not represent the same date for Americans as it does Europeans.
Helpers are generally preferable to placeholders, as they are always visible, thereby requiring less short-term memory. Fields with placeholders are also less noticeable than empty fields and susceptible to being skipped.
Use placeholders when space is limited, for example, when Date Time Picker is used as a grid filter.