OData V4 sap PlanningCalendarRow formatter not working correctly
See original GitHub issueI have an issue with oData v4 with UI5 planningcalendar. I have added the formatter inside XML view: .formatter.date.
When consuming the oData V4 with STARTDATE & ENDDATE metadata type: Edm.Date, I got an error message from the UI: cannot read property getTime of undefined.
The value from STARTDATE and ENDDATE oData V4 is:
And oData v4 metadata:
Here is my XML code:
<PlanningCalendarRow title="{zearnModel>PRODUCT_NAME_SHORT}" appointments="{model: 'zearnModel', path : 'EventItem', templateShareable: 'true'}" text="{zearnModel>PRODUCT_NAME_CAPTION}}" icon="" selected="false"> <appointments> <unified:CalendarAppointment title="{zearnModel>EVENT_DESC}" text="{zearnModel>EVENTTYPE_DESC}" icon="sap-icon://family-care" startDate="{path: 'zearnModel>STARTDATE', type: 'sap.ui.model.type.Date', formatOptions: { pattern: 'yyyy/MM/dd' }, constraints: { V4: true }, formatter: '.formatter.date'}" endDate="{path: 'zearnModel>ENDDATE', type: 'sap.ui.model.type.Date', formatOptions: { pattern: 'yyyy/MM/dd' }, constraints: { V4: true }, formatter: '.formatter.date'}" type="{path: 'zearnModel>EVENTTYPE_DESC', formatter: '.formatter.PORType'}" selected="false" tentative="false"/> </appointments> </PlanningCalendarRow>
And formatter.js is:
date: function(date) { console.log("XXXXXXXXXXXX"); console.log(date); return new Date(date); },
The date function in formatter.js is never being called (I didn’t see the log is printed out), the UI just throw an error that I mentioned above.
Is this a bug in PlanningCalendar UI5 ? Kindly help to investigate this issue. Thanks so much.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Hello,
I apologize for the delayed response. We’ve fixed the problem. The fix is now available since openUI5 version 1.69
Regards, Todor
@Todor-ads do you have any update to share regarding this issue created 2 years ago?