question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OData V4 sap PlanningCalendarRow formatter not working correctly

See original GitHub issue

I 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:

fd5 And oData v4 metadata: fd1

Here is my XML code: fd4 <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. fd2

Is this a bug in PlanningCalendar UI5 ? Kindly help to investigate this issue. Thanks so much.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Todor-adscommented, Jun 17, 2021

Hello,

I apologize for the delayed response. We’ve fixed the problem. The fix is now available since openUI5 version 1.69

Regards, Todor

0reactions
pdominiquecommented, Jun 17, 2021

@Todor-ads do you have any update to share regarding this issue created 2 years ago?

Read more comments on GitHub >

github_iconTop Results From Across the Web

SAPUI5 Planning Calendar OData V4 - SAP Community
The OData V4 has this metadata type for StartDate and EndDate as Edm.Date. ... I also feel that the formatter function is not...
Read more >
Formatter is not working - SAP Community
Hi All, I'm trying to format values using formatter in table but it is not working and empty values ... var oModel =...
Read more >
Formatter total function not calculating correctly with code ...
Hello, Can anyone see why my total formatter is now miscalculating with this new code change to an init function?
Read more >
Can I use oData calls within a formatter? - SAP Community
Function import works just fine, my problem is that the formatter doesn't seem to wait for the data coming back from the oData...
Read more >
OData binding problem with types - SAP Community
I do the odata connecting (V4) in the controller.js, and with the table id I bind the data to the sap.m.table. If I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found