Skip to main content

Function: formatDateForUI5()

formatDateForUI5(date, format): string

Defined in: src/modules/date.ts:176

Formats a Date object into a UI5-compatible date string.

Parameters​

date​

DateInput

The date to format (Date object or ISO string).

format​

string

The target format pattern.

Returns​

string

The formatted date string.

Remarks​

Pure function (no browser context). Supports the five patterns in DATE_FORMATS.

Throws​

ControlError if the format is unsupported or the date is invalid.

Example​

formatDateForUI5(new Date(2024, 0, 15), 'yyyy-MM-dd'); // '2024-01-15'
formatDateForUI5(new Date(2024, 0, 15), 'dd.MM.yyyy'); // '15.01.2024'