cancel
Showing results for 
Search instead for 
Did you mean: 

SAP WebIDE - UI5 - Date field is not showing correct date

balaji_vta
Participant
0 Kudos

Hi,

I am using UI5 version 1.44. There is one date field (Date picker) in the application. Database value for this field is for ex: 21Dec2017. The value of this field at Gateway system is the same as database value while oData service testing. When I use UI5 application, it is showing as 20Dec2017. It is always showing one day less to database value. I tested with different dates. it is responding in the same manner. Did I miss anything? please help me to fix this issue.

Thank you,

Balaji P.

Accepted Solutions (1)

Accepted Solutions (1)

balaji_vta
Participant
0 Kudos

I was in chat with SAP and fixed the issue..

In my index file of the project, there are library names..

data-sap-ui-libs="sap.m,sap.ui.commons,sap.ui.table,sap.ui.ux3"

SAP suggested to remove all except "sap.m"

and format for date as below.

<DatePicker value="{path: 'Begda', type: 'sap.ui.model.type.Date', formatOptions: {pattern: 'MM/dd/yyyy', strictParsing: true , UTC: true}}" width="10em" id="Begda" required="true"/>

Answers (4)

Answers (4)

junwu
Active Contributor

what data type of that field?

your fontend code?

0 Kudos

Dear Balaji,
I also faced the same issue, I solved it by appending custom timer in my controller,

	var date = new sap.ui.model.type.Date();
			date = this.getView().byId("dt_dtField").getValue();
			date = new Date(date + " 11:13:00"); 
balaji_vta
Participant
0 Kudos

Hi Khalid,

Thank you for the response. I also did manipulation like this but it is in Get method.

Thank you,

Balaji P.

balaji_vta
Participant
0 Kudos

Hi Jun,

Field data type is "DatePicker". This is automatically assigned when I use ref.field from Model.

Thank you,

Balaji P.

richard-zhao
Employee
Employee
0 Kudos

Hello, Balaji. Does the UI5 application is running on server has different time zone with your Database service?

balaji_vta
Participant
0 Kudos

Hi Richard,

Thank you for the response. My backend SAP system, Gateway system and my PC all are in PST. Is there any option to check timezone in WebIDE?

Thank you,

Balaji P.