on 2020 Sep 24 9:23 PM
Hello Experts,
I'm experiencing a weird scenario where the date range in the UI5 datepicker is not picking up the correct values. Let me summarize the steps done and what exactly the issue am facing.
I have placed the datepicker range as per the following code in the view.xml file.
<DateRangeSelection id="dateCreatedOn" placeholder="{i18n>enterCreatedOn} ..." valueFormat="MM-dd-yyyy" displayFormat="MM.dd.yyyy"/>
Date range selected in the user screen is captured in the controller.js as shown below.
if (dateCreatedOnFrom && dateCreatedOnTo) {
dateCreatedOnFrom = new Date(dateCreatedOnFrom);
dateCreatedOnTo = new Date(dateCreatedOnTo);
this.inputFilters.push(new Filter("CreatedOn", FilterOperator.BT, dateCreatedOnFrom, dateCreatedOnTo));
}
As you can notice when debugging this in Chrome, date range values i.e., both from and to are fine.
Date ranges selected in the UI5 application:
Values in Google Chrome console:
But when the odata call is triggered to SAP Gateway 'dateCreatedOnTo' value is changed i.e., increased by 1 day when the odata call is triggered.
/SearchResultSet?sap-client=110&$filter=CreatedBy eq 'SUZIP' and (CreatedOn ge datetime'2020-09-21T04:00:00' and CreatedOn le datetime'2020-09-25T03:59:59.999')
When call reached the backend i.e., ECC, we can notice the changed date values which leads to pull wrong data.
Note:
SAPUI5 version: 1.71.4 is deployed in the Gateway FrontEnd server.
Please shed some lights on this issue. Thank you for the support.
Regards
Praba
Request clarification before answering.
Thanks a lot folks. I now understood what the problem is. Much appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
11 | |
9 | |
8 | |
7 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.