Skip to Content
0
Dec 09, 2022 at 12:50 PM

Date/Time Fields in Fiori Elements with CAP and OData V2 Proxy are not displayed

449 Views

Hi experts,

I have a CAP application with the OData V2 proxy.
For this I have generated a Fiori Elements App with V4 and V2.
You find the app here: https://github.com/marianfoo/ui5-cc-excelUpload-sampleapp

In CAP I have defined four elements that have to do date/time:

validFrom : DateTime;
timestamp : Timestamp;
date : Date;
time : Time;

In V4 I have no problems with create and display.
In V2 I also have no problem with create, but with display.
None of the above mentioned elements are displayed.
For example when i open OrderNo 2 and open OrderItems 252 Eleonora i get this error and the date is empty:

image.png

Log-dbg.js:452 2022-12-09 13:45:13.585300 FormatException in property 'text' of 'Element sap.m.Text#ui.v2.ordersv2::sap.suite.ui.generic.template.ObjectPage.view.Details::Orders_Items--com.sap.vocabularies.UI.v1.Identification::date::Field-text': Illegal sap.ui.comp.smartfield.type.DateTime value: /Date(1640995200000)/
Hint: single properties referenced in composite bindings and within binding expressions are automatically converted into the type of the bound control property, unless a different 'targetType' is specified. targetType:'any' may avoid the conversion and lead to the expected behavior. -

Here the correct result in the V4 App

image.png

What could be the cause of this error?
The only bugs I found in this direction with CAP are already older and fixed.

Thank you for your help!

Attachments

image.png (43.1 kB)
image.png (9.0 kB)