Skip to Content
0
May 25, 2018 at 12:56 PM

How to configure DatePicker so that getValue returns value in the same format as displayed

2062 Views

Hi,

I am using sap.m.DatePicker which displays dates like this: May 25, 2018. The api says "By default, the medium format of the used locale is used." (https://sapui5.hana.ondemand.com/#/api/sap.m.DatePicker/methods/getDisplayFormat)

When calling getDisplayFormat, it returns null.

When calling getValue, it returns dates like this: 5/25/18. The api says "By default the short format of the used locale is used." (https://sapui5.hana.ondemand.com/#/api/sap.m.DatePicker/methods/getValueFormat)

When calling getValueFormat, it returns null.

How do I get the displayed format from DatePicker for every locale, not only for en?

Since getDisplayFormat returns null, I can not set this value with setValueFormat.

Thank you very much und best regards,

Christian.