Intro
The date/time picker is a UI component that lets users select both date and time values within a unified input field. It combines a calendar view with time selection, supporting both compact and cozy display modes.
Date/time picker
Component availability
This component is available in the following libraries:
When to Use
Use the date/time picker to:
- Let the user select both date and time in a single input field.
Don’t use the date/time picker to:
- Let the user select only a date. Use the date picker instead.
- Let the user select only a time. Use the time picker instead.
- Define minimum and maximum limits to restrict date and time selection to an approved range.
- Configure minute and second step values to create predictable increments for time selection.
- Allow users to manually enter values and rely on the component to parse valid input automatically.
- Offer a “current date” or “current time” shortcut to help users return quickly to the present moment.
- Use interaction and value states to provide clear visual and semantic feedback during user input.
- Use Compact or Cozy modes to adapt the component to different screen sizes.
- Use an icon button, text button, or link to trigger the opening of the popover when space is limited or when required by application logic.
- Provide tooltips on the date/time picker button and calendar or clock selection interfaces to improve clarity and discoverability.
- Support week numbers when the business use case requires weekly planning.
- Show a timezone indicator when the input depends on regional time accuracy.
- Use mixed calendar mode when you need to support two calendar systems in a single view.
Anatomy
A date/time picker consists of the following elements:
- Date/time picker input field: Displays the selected value and enables manual entry.
- Date/time picker button: Opens a popover for selecting date and time.
- Time picker container: Displays the clock interface and lets users select a time in hours, minutes and seconds.
- Footer: Provides the OK and Cancel actions.
- Date picker container: Displays the calendar for selecting a date.
Data/time picker anatomy
Types
Basic date/time picker
The date/time picker lets users select both the date (day, month, and year) and time (hours, minutes, and seconds) in a combined input.
Basic date/time picker
Restricted date range
The date/time picker component can be configured with minimum and maximum limits so the user can select only within the valid range.
Restricted date/time picker
States
The date/time picker incorporates various states to ensure a clear and intuitive user experience, enhancing both interaction and status validation. Each state visually communicates the component's current status and supports user navigation.
Component states
A. Enabled: The component is interactive and can receive input.
B. Disabled: The component is not interactive and cannot receive input.
C. Read-only: The value is visible but cannot be edited.
Date/time picker component states
For more information, see Component States.
Interaction states
The date/time picker has five interaction states, which represent different parts of the component:
A. Regular: The default state of the input field and the button.
B. Hover on input: When the cursor hovers over the input field.
C. Hover on button: When the cursor hovers over the date/time picker button.
D. Active: The input field is focused, allowing the user to enter or edit text.
E. Active button state: The date/time picker button is active, displaying the calendar and the clock.
Date/time picker interaction states
For more information, see Interaction States.
Value states
Date/time picker value states
For more information, see How to Use Semantic Colors.
Value states with value state message
A. Negative: Signals an error and instructs the user to correct the value.
B. Critical: Indicates a potential issue that requires attention but is not an error.
C. Positive: Confirms a valid input.
Note: The positive state does not display a message popover.
D. Information: Displays general information or guidance that is not critical but can help users complete their tasks.
Date/time picker value states with value state message
For more information, see Value States.
Focus state
The focus state determines which component receives the user input when using an input device, such as a keyboard. By default, the focus is on the current date, but another date can be set as the initial focus if needed, depending on the app’s context or user flow.
A. Unfocused state applies to all date and time units that are not focused.
B. Focused state is visualized by an additional border around the focused date time units.
Unfocused and focused states for the date/time picker
For more information, see Focus States.
Selection state
The selection state indicates which date or time option is currently chosen by the user. The state is applied after the user selects an element, clearly distinguishing the selected element from others.
A. Unselected: The state occurs when an element is not selected, displaying the element in its regular (default) state.
B. Selected: The state shows that an element is selected and visually differs from the unselected state.
Selected and unselected states for the date/time picker
For more information, see Selection States.
Behavior and Interaction
Manual entry
The date/time picker component provides the option to manually enter date and time values directly into the input field. The manually typed values should follow the format shown in the placeholder text.
When the user clicks the input field (A), the component becomes active and focused (B). After the user enters a valid date and time according to the expected format, the component automatically parses this value (C). The newly entered date and time then display within the field, reflecting the successful input.
Date/time picker input field interaction
Date/time picker button and popover interaction
The date/time picker component includes a dedicated button that opens a popover with calendar and clock selection controls. When the user clicks this button (A), the popover (B) appears, providing an intuitive interface for navigating through months and years, selecting a date, and adjusting time values. After choosing the desired date and time, the user confirms the selection by clicking the OK button in the footer, which closes the popover and populates the input field. If the user clicks Cancel or anywhere outside the popover, the selection is discarded, and the input field retains its placeholder text.
Date/time picker button and popover interaction
Opening the date/time picker by another component :badge, info, large, _, SAPUI5 Only:
The date/time picker can be opened by another component such as text button, icon button, or link. In this case, the component appears as a popover with date and time selection without the input field.
Date/time picker opened by another component
Tooltip
The date/time picker supports tooltips for the date section, the time section, and the input (optional). For more information and visuals, see the calendar and the time picker.
Tooltip on the date/time picker button
Responsiveness
Date/time picker sizes
The date/time picker is responsive and works on all devices and form factors. The examples below illustrate how the component adapts its size and layout based on screen resolution and interaction type. For sizes S and M use Cozy mode, whereas for size L and XL, use Compact mode. For more information, see Content Density (Cozy and Compact).
Size S (Smartphones)
On smaller devices, the user can choose the date and time value in arbitrary order by tapping the segmented button on top of the screen. Be aware that the popover is superimposed on the input field during the selection process for mobile S sizes.
The user can select the desired date from the calendar, and the time from the clock. For the time, it’s possible to select hours, minutes, and even seconds. Clicking a date in the calendar automatically takes the user to the time selection screen.
When the user selects OK, the popover closes, and the selected date and time appear in the input field. When the user selects Cancel, the action is canceled, and the input field remains unchanged.
Date/time picker in size S cozy mode
Size M (Tablets)
The popover opens as a standard overlay near the input field, offering a balanced layout that supports both touch input and manual text entry. The interaction is the same as that on Size S.
Date/time picker in size M cozy mode
Size L (Desktops)
The date/time picker appears as a popover when the user clicks the date/time button in the input field. The user can then select the desired date from the calendar and the time from the clock. For the time, it’s possible to select hours, minutes, and seconds.
When the user clicks the OK button, the popover closes, and the selected date and time appear in the input field. When the user selects Cancel, the action is canceled, and the input field remains unchanged.
If there is no value in the input field, no date is selected. The user needs to explicitly pick a date from the calendar. If a date is already selected and the user changes the year or the month, the date selection is cleared, and the user needs to pick again.
Date/time picker in size L compact mode
Accessibility
SAP follows international standards, such as WCAG and WAI-ARIA, and strives to make our business solutions accessible and inclusive.
For more information, see Accessibility in SAP Fiori and the Accessibility Design Tools Handbook.
Keyboard navigation
The following keyboard combinations are supported by the SAPUI5 Date/time picker component.
Note that, in addition to the standard behaviors, the date/time picker introduces specific focus management between the date picker container and the time picker container. For more information on date selection and time navigation, see the date picker and the time picker.
Screen reader support
For details on screen reader support and Accessible Rich Internet Applications (ARIA), see UI5 Screen Reader Support and WAI-ARIA Authoring.
Content
Placeholder
Date/time picker with different format pattern
Formatting dates and times
You can use three different types of date and time formats: short, medium, and long. The formatting and order of the values differ based on the local settings that have been configured in the browser.
Formatting dates and times examples
Special dates with legend :badge, info, large, _, SAPUI5 Only:
For irregular or non-recurring events, the date/time picker supports special dates that can be highlighted in the calendar. Provide a legend whenever special dates are displayed to explain the meaning of the highlighted dates. Select from the predefined set of legend colors.
The legend can appear as a static element that stays visible next to the calendar, or as a dynamic option opened through a “Special Days” button. Choose the static or dynamic presentation based on available screen space and legend complexity.
Date/time picker with legend
Localization
The date/time picker supports left-to-right (LTR) and right-to-left (RTL) reading directions.
Right-to-left text direction in the date/time picker
Features
Timezone
Global configuration
The date/time picker can rely on both local and global configuration for timezone handling. The implementation determines which timezone is applied for the given use case.
Local configuration :badge, info, large, _, SAPUI5 Only:
The timezone is shown inside the input field. When users click on it, a popover appears showing the full name of the timezone.
Date/time picker with timezone (local configuration)
Minutes and seconds step :badge, info, large, _, SAPUI5 Only:
The time picker allows configuration of step values for both minutes and seconds. By default, time values increase or decrease by 1 unit (for example 1 → 2 → 3). However, you can define a custom step increment, such as 5 or 15, to skip values accordingly. For example, if the minute step is set to 5, the sequence will follow 0 → 5 → 10 → 15, and so on.
Date/time picker with minute step set to 5
Current date and time :badge, info, large, _, SAPUI5 Only:
The date/time picker can include shortcut buttons for quickly setting the current date or current time. When clicked, these buttons automatically update the input to reflect either today’s date or the exact current time, depending on the context.
Each button appears within the calendar or time selection view, providing users an easy way to return to the present moment without needing to scroll or manually adjust the fields.
These shortcut buttons are optional and can be enabled depending on the specific requirements of the use case.
Date/time picker with current date and time buttons
Show/hide week numbers
The date/time picker can optionally display week numbers in a dedicated column to the left of the calendar grid. This feature is typically used in views where planning by week is relevant. Whether week numbers are shown depends on the app’s use case and should be configured accordingly.
Date/time picker with and without week numbers
Mixed calendar
The mixed calendar view supports a combination of two different calendars into one calendar view. The week numbers are not available for this type of calendar.
Date/time picker with primary (Islamic) and secondary (Gregorian) calendar type
Framework Comparison
Some behaviors differ between frameworks due to implementation specifics. The table below summarizes the differences between SAPUI5 and SAP Web Components and lists the framework-specific patterns.
[internal_only]To request one of these features for SAP Web Components, submit an InnerSource request.[/internal_only]
Related Links
Implementation
SAPUI5
Date/Time Picker
(samples)
Date/Time Picker
(API reference)
SAP Web Components
Date/Time Picker
Guidelines
Components
Time Picker
Date Picker
Calendar
Formatting Time
Formatting Dates
Implementation
SAPUI5
Date/Time Picker
(samples)
Date/Time Picker
(API reference)
SAP Web Components
Date/Time Picker
UI Kit (Figma)
SAP Fiori for Web UI Kit / Date/Time Picker