Intro
The calendar is a UI component used to select a single date, multiple days, or a date range. It displays time-related data such as year, month, and date, and supports navigation between months and years, including multi-month views.
Calendar
Component availability
This component is available in the following libraries:
When to Use
Use the calendar to:
- Let users select a single date, multiple days, entire week, or a date range.
- Display multiple months at once.
- Provide a date selection control that is always visible and prominent.
- Help users view the year, month, week, and date together when making a selection, for example when choosing a date based on the day of the week.
- Allow users to select dates visually and avoid ambiguity caused by locale-specific date formats, such as day-month-year or month-day-year.
- Highlight special days or hide and disable specific dates.
Don’t use the calendar to:
- Allow entering large amounts of data. Use the date picker instead.
- Handle scenarios where the keyboard is the primary input method. Use the date picker instead.
- Display a permanently visible calendar when screen space is limited.
- Support scenarios where selecting a date range is the user’s primary task. Use date range selection instead.
- Display a range of weekdays in a single row. Use the calendar date interval instead.
- Compare calendars from multiple people. Use the planning calendar instead.
- Select combined date and time values. Use the date/time picker instead.
- Use mixed calendar views only when users need to work across different calendar systems.
- Set minimum and maximum dates to restrict selection and prevent invalid or irrelevant choices.
- Support the selection of weeks by calendar week numbers for week-based planning.
- Show calendar week numbers only when users benefit from weekly planning.
- Mark non-working days as consistent blocks and position them adjacent to weekends.
- Highlight irregular holidays or events as special days and explain them using a legend.
- Support multiple-month view when selection across two months is likely (for example, planning a vacation).
- Provide a “Today” icon button to let users quickly navigate back to the current date.
Anatomy
The calendar supports date, month, and year view and consists of the following elements:
- Previous month button: Moves calendar view back to previous month.
- Month view button: Opens the view for selecting a specific month.
- Year view button: Opens the view for selecting a specific year.
- Next month button: Moves calendar view to next month.
- Days of the week: Displays the names of the weekdays (for example, Mon, Tue, Wed, Thu, Fri, Sat, Sun).
- Today: Indicates the current day on the calendar.
- Non-working day: Marks weekends or other non-working days.
- Days from next month: Displays days from adjacent months for easier navigation.
- Selected day: Highlights the day currently chosen by the user.
- Working day: Regular weekday displayed in the calendar grid.
- Calendar weeks (optional): Displays week numbers.
Calendar anatomy
Month view
- Previous year button
- Year view button
- Next year button
- Selected month button
Month view calendar anatomy
Year view
- Previous year range button
- Year range button
- Next year range button
- Selected year button
Year view calendar anatomy
Types
There are three calendar types based on the selection behavior:
A. Single-day selection
B. Multiple-day selection
C. Range selection
Single day, multiple day, and range selection calendar types
There are also types based on the level of granularity users can select:
A. Month view
B. Year view
C. Year range view
Month view, year view, and year range view
Mixed calendar
Mixed calendar
Multiple months view :badge, info, large, _, SAPUI5 Only:
Displays two months vertically one under another, allowing users to select dates across month boundaries. It supports single day, multiple day, week, or date range selection.
Note: This view supports displaying multiple months. However, we recommend showing two.
Multiple months view - vertical orientation
States
The calendar component supports states that indicate interaction and status. Each state communicates the current status and supports navigation.
Component states
The dates in the calendar support two states: enabled and disabled.
A. Enabled state: Displays an interactive date.
B. Disabled state: Displays a non-interactive date.
Calendar component states
For more information, see Component States.
Interaction states
The enabled date cells support two interaction states: regular and hover.
A. Regular: Displays the default state.
B. Hover: Displays the hover state when the cursor is over an enabled date cell.
Calendar interaction states
For more information, see Interaction States.
Focus state
The focus state indicates which element is focused.
A. Unfocused: Displays the default, unfocused state.
B. Focused: Displays a visible focus border around the date (for example: 25th), month, or year.
Calendar focus state
For more information, see Focus States.
Selection state
Selection state is applied after the user selects an element. The selected element is visually distinct from other elements.
A. Unselected: Displays the default, unselected state.
B. Selected: Displays the selected state, visually distinct from unselected elements.
Calendar selection state
For more information, see Selection States.
Behavior and Interaction
The behavior and interaction of the calendar depends on the calendar type. Some interactions are only available for specific calendar types.
Selection
The calendar supports different types of selection:
- Single day: The user can select a single day at a time.
- Multiple days: The user can select multiple random non-consecutive days.
- Range: The user can select multiple days from a start date to an end date.
Single-day selection
The user can select a single day. The selected day remains selected when navigating across months. Clicking the same day twice deselects it.
On touch devices, interaction is similar but without hover. Use a single-finger tap gesture. For more information, see Gestures.
Using mouse device to select a day in the calendar
Multiple-day selection
The user can select multiple non-consecutive days by clicking each day individually. Clicking the selected days again deselects them.
Using mouse device to select multiple days from the calendar
Selecting a date range
The user can select a date range by clicking on the first day and then the last day. All days in between are selected. The selected range is preserved while switching between months.
Using mouse device to select date range from the calendar
Selecting an entire week :badge, info, large, _, SAPUI5 Only:
If the calendar week number is displayed, users can select an entire week by clicking its week number. The selected week is preserved when switching between months, even if the week spans across two months.
Selecting an entire week using mouse device
Month and year navigation flow
The user can navigate through months, years, and year range by clicking the previous/next calendar buttons and selecting the month, year, or year range controls.
Changing months with previous/next buttons
Clicking the navigation buttons moves to the previous or next month within the same year.
Navigating through different months using the previous/next buttons
Changing months in month view
When selecting the month at the top, the calendar switches to a month view, showing all months of the year. After selection, the calendar returns to the day view and displays the chosen month.
Changing months in month view
Changing years in year view
Clicking the year button at the top opens the year view of the calendar. After a year is chosen, the calendar returns to the day view and displays the selected year.
Changing years in year view
Changing year range
Selecting the year range button at the top opens the year range view of the calendar. After a range is chosen, the calendar returns to the year view and displays the selected year.
Changing year range in the year range view
Two-month calendar navigation – vertical
In the two-month view, the user can navigate through months via previous/next buttons. The months change with a step of one month. Example: October – November changes to November – December.
Navigating through different pair of months using the previous/next buttons – vertical orientation
Tooltip
The calendar supports tooltips for:
- Previous/Next buttons
- Month view and year buttons
- Today
- Special days
- Non-working days
- Current day button if enabled
For detailed guidance on interaction patterns and tooltip behavior, refer to the Tooltip.
Calendar tooltips
Responsiveness
Use the calendar within a responsive layout container. The calendar itself is not responsive.
The calendar is optimized for both cozy and compact content densities.
- Compact reduces the dimensions to display more information within the interface, making it suitable for devices operated with a mouse and keyboard.
- Cozy uses larger dimensions optimized for fingertip interaction, supporting touch devices.
For more information, see Content Density (Cozy and Compact).
Calendar in compact and cozy mode
Multiple-month view switches to one-month view in cozy mode
When using the multi-month view, the calendar adjusts based on screen size. On small screens, only a one-month calendar is displayed.
Responsiveness from two-month view to a single-month view on mobile device
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 calendar component.
Screen reader support
For details on screen reader support and Accessible Rich Internet Applications (ARIA), see the UI5 Screen Reader Support and WAI-ARIA Authoring.
Content
Mixed calendar
The mixed calendar view supports a combination of two different calendars into one calendar view. The number of weeks is not available for this type of calendar.
Mixed calendar in day view (A), month view (B) and year view (C).
Legend
The legend explains days with special markings and colors used in the calendar. It includes 20 placeholders for custom colors and a set of standard colors:
A. Standard: Legend items such as today, selected, working day, and non-working day.
B. Special: Legend items such as appointments or other irregular events. The appointment section includes color values for different appointment types, which must be configured in the app.
The legend can appear next to the calendar or be accessed via a Special Days button.
Calendar legend showing 4 standard and 10 custom-colored items
Localization
The calendar supports left-to-right (LTR) and right-to-left (RTL) reading directions. All features are supported in both directions.
Left-to-right calendar
Right-to-left calendar
Features
Supported calendars
The calendar supports five calendar types – Gregorian (default), Islamic, Japanese (A), Persian (B), and Buddhist (C).
Examples of Japanese, Persian, and Buddhist calendars
Setting calendar weeks
The calendar lets you configure the first day of the week and the first week of the year by selecting a calendar convention. Available conventions include Default, which is based on the active format locale, ISO 8601 (A), Middle Eastern (B), and Western Traditional (C).
Calendars using the ISO 8601, Middle Eastern, or Western Traditional convention
Showing/Hiding calendar week numbers
The calendar can display or hide the week numbers based on the configuration settings. This feature is typically used in views where planning by week is relevant.
Calendar examples with and without week numbers
Pre-selected date or range
It is possible to define a pre-selected date or a specific date range that appears automatically when the user first opens the calendar. New selections will clear the pre-selected dates.
Calendar with a pre-selected date or date range
Adjusting calendar width :badge, info, large, _, SAPUI5 Only:
The calendar is not responsive, but you can adjust its width depending on the use case. This helps maintain visual balance, readability, and alignment with surrounding UI elements.
Calendar with modified width
Start/End of the week :badge, info, large, _, SAPUI5 Only:
Calendar showing Tuesday as a first day of the week
Restricted date range
The calendar can be configured with a minimum and a maximum date that restrict the range of selectable days. Dates outside the defined range are visually disabled and cannot be chosen.
Note: The today’s date can be focusable even if it is not in the defined range.
Calendar with restricted date range
Disabled dates
Calendar with disabled dates
Non-working days
The calendar allows the definition of non-working days. They should follow a consistent pattern and be adjacent to the weekend days.
Note: If you need to mark random days, highlight them as special days with legend.
Calendar with marked non-working days
Custom initial focus date :badge, info, large, _, SAPUI5 Only:
Calendar with pre-focused date
Current date :badge, info, large, _, SAPUI5 Only:
Calendar with “Today” button
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
Guidelines
Components
Date/Time Picker
Date Range Selection
Calendar Date Interval
Planning Calendar
Gestures
Implementation
SAPUI5
Calendar (samples)
Calendar (API reference)
SAP Web Components
Calendar
Calendar Legend
Guidelines
Components
Date/Time Picker
Date Range Selection
Calendar Date Interval
Planning Calendar
Gestures
Implementation
SAPUI5
Calendar (samples)
Calendar (API reference)
SAP Web Components
Calendar
Calendar Legend
UI Kit (Figma)
SAP Fiori for Web UI Kit / Calendar