This article describes the international rules for date formats. The SAPUI5 date formatters will help you to comply with these rules.
Dates in short format are displayed as digits for the day, month, and year. Use the right formatting to avoid errors caused by the wrong format!
Use the long format if you need to display the full names of months. Sometimes there is no difference between the medium and long format.
If you need to display the day of the week, use the full date format.
If it suits your use case, such as ongoing events within a period of six days, use the relative format. Relative dates are displayed as text, for example, today, 6 days, and so on.
The default range for relative dates is between -6 and 6 days relative to the current date.
- In general, use the medium date format.
- Use the date picker control if dates have to be entered in an input field.