cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Table - Date column timezone issues, date 1 day less

I have a Smart Table and I am filling Created Date from the oData Service.

In the oData Service the date comes in as - Date(1495152000000)

The date in my ECC is a Datum field and has value - 05/19/2017

I am currently in IST time zone and for me the JavaScript Date object comes as - Fri May 19 2017 05:30:00 GMT+0530 (India Standard Time)

The client is in CST time zone and for them the JavaScript Date object comes as - Thu May 18 2017 19:00:00 GMT-0500 (Central Daylight Time)

I understand this is happening because JavaScript takes the local system time zone and then renders the same.

The solution for this can be found in the blog - https://blogs.sap.com/2013/04/28/working-with-odata-dates/

As per this, I need to add the Time zone offset and I should be good.

As per another blog - https://archive.sap.com/discussions/thread/3889690 and https://archive.sap.com/discussions/thread/3602595 , I can setUTCDate function of JavaScript too.

The issue I am facing is I am auto binding my data to the Smart table, so how do I change these values in the front end.

Also as per blog - https://archive.sap.com/discussions/thread/3441583 , setting the sap:display-format="Date" for my Property. I have done this in my annotations, but this doesn't solve my problem.

Accepted Solutions (1)

Accepted Solutions (1)

This is solved by using a formatter and converting the date in the formatter by considering the time zone offset.

Former Member

You can just add a custom data attribute to the smart filter bar with the date format settings:

<sfb:customData>
<core:CustomData key="dateFormatSettings" value='\{"UTC": true}' />
</sfb:customData>

Answers (0)