Formatting Time
sap.ui.core.format.DateFormat
Intro
This article describes the international rules for time formats. The SAPUI5 time formatters will help you to comply with these rules.
Usage
Use time formatting if:
- You need to display time based on the user’s locale settings.
Types
You can use three different types of time formats: short, medium, and long. The formatting and order of the values differ based on the locale settings that have been configured in the browser.
Short
Formatting differences - Short format
Medium
Formatting differences - Medium format
Long
Formatting differences - Long format
Guidelines
-
- In general, use the short format.
- Use the correct time format according to your language or locale settings.
[internal_only]
- Use the time picker control when a time has to be entered into an input field.
- If you have to display a time format as an object attribute, follow the formatting rules for the object header and object list item attribute.
[/internal_only]
Durations
If you need to display durations, show every number and unit of measurement according to the rules for units of measurement. (For example, use long text instead of ISO codes or abbreviations.)
Do
Use long text to display durations
Don't
Do not use abbreviations when durations have to be displayed
Time Intervals
Example of how to display time intervals
Resources
Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.
Elements and Controls
- Date Picker (guidelines)
- Object List Item (guidelines)
- Object Number (guidelines)
Implementation
- Time Format (SAPUI5 API reference)
- [internal_only]Time Picker (SAPUI5 API reference)[/internal_only]
Visual Design
- No links