Skip to Content
0

Date mismatch in SAP UI5 Application

Sep 11, 2017 at 09:24 AM

132

avatar image

I have an Date Picker in SAP UI5 application. actual server is in Australia. When I create any record in IST time, it is working fine. But when an user tries to create any record in Australia, the Date value is increment to +1. That is 31 coming as 32. Do i need to consider the timeZone?

Regards Saanvi S

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Naga Prakash Sep 11, 2017 at 12:25 PM
1

Hi Saanvi,

The Data Picker date object includes the time zone due to which you are getting the issue.

Approach1: use property "valueFormat" e.g 'YYYYMMDD' and read the value by the method this.getView().byId("iddate").getValue() and pass this value to OData service.

Approach2: you can use below code as formatter function to remove the time zone from the Data Picker date object.

var dateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({
		pattern: "yyyy-MM-ddTKK:mm:ss"
	});
	return dateFormat.format(d);

Thanks,

NP

Share
10 |10000 characters needed characters left characters exceeded
Sharath M G Sep 11, 2017 at 12:10 PM
1

Yes, you need to consider the timezone. Check the usage of the property "valueFormat" for this purpose.

Regards,
Sharath

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks For your response

0