Hi Christian,
I found out a more SAPUI5 like way to do this without any third party lib.
This method works for all kinds of language specific formatting. The key word you are looking for is “Binding Expression”. With a binding expression you can define a type for your binding like Date, Float, Currency, etc. If you do that UI5 will handle all language specific formatting dependigng on your users browser settings. If you don’t want this browser settings thing you can also define your own format or a total custom formatter.
This is a example for a date type expression for the “text” Property of a Text Widget:
{
path: ‘variableHolder>/MyDate’,
type: ‘sap.ui.model.type.Date’,
formatOptions: {
source: {
pattern: ‘yyyy-MM-dd’
}
}
}
Click the chain-icon on the text property of your widget to define this expression.
Here is a list of all supported types: https://openui5.hana.ondemand.com/1.71.22/#/api/sap.ui.model.type
Cheers
Christopher