cancel
Showing results for 
Search instead for 
Did you mean: 

DateRangeSelection is retrieving records for the previous day

Former Member
0 Kudos

Hi!

I have a DateRangeSelection, where the user can select a range between date A and date B.

However, I'm having a odd behaviour on the link generated to query the SAP Gateway. For you to understand and going straight to the point, on the example bellow I selected a range between data A and A (the same day):

RANGE: 06.05.2016 - 06.05.2016 (there is no Time Picker at this page).

RESULT: selects all the records for the previous day.

  • If I check the Network (using Chrome Debugger) I can find this:
    • .../sap/opu/odata/SAP/Z.._SRV/Report_OperacoesSet?$filter=(FSAVD ge datetime'2016-05-05T23:00:00' and FSAVD le datetime'2016-05-05T23:00:00').
  • If I debug the variable picked, it selects the correct value (2016-05-06T00:00:00)

Do you have any idea how to fix this?

Thanks in advance!

Hugo

Accepted Solutions (0)

Answers (1)

Answers (1)

jibin_joy
Contributor
0 Kudos

Hi Hugo ,

Can I know How Date Object is Converted to datetime'2016-05-05T23:00:00' . I think there might be issue in conversation .

Regards,

Jibin Joy

Former Member
0 Kudos

Hi Jibin

We are using the standard feature to gather the dates and build the filter:

var searchDateEnd = new sap.ui.model.Filter("FINISHDATE", sap.ui.model.FilterOperator.BT, inputReportEndDate.getDateValue(),inputReportEndDate.getSecondDateValue());

Using the debugger over the inputReportEndDate.getDateValue() it seems OK with 2016-05-06T00:00:00 GMT+01 .

Probably this is a timezone issue. I want to avoid to manipulate the date values to correct the timezone by adding an offset corresponding on the difference between the timezone I am right now (GMT +01) vs the default timezone (GMT +00), I want to believe that SAP has a standard way to fix / correct this behaviour!

Regards,

Hugo

jibin_joy
Contributor
0 Kudos

Hi Hugo,

Yes u r right ... Looks like it is Bug !!!

Regards,

Jibin Joy