Skip to Content
0

DateRangeSelection

Oct 24, 2017 at 02:19 PM

40

avatar image
Former Member

I have a probleme:

<DateRangeSelection

delimiter= "-"

displayFormat="yyyy/MM/dd"

dateValue="{path:'/dateValueDRS1'}"

secondDateValue="{path:'/secondDateValueDRS1'}"

minDate="{path:'/dateMinDRS1'}"

maxDate="{path:'/dateMaxDRS1'}"

change="handleChange"/>

handleChange : function(oEvt){

var filters = [];

var query = oEvt.getParameter("query");

if(query){

var to_dat = new Date(to);

var to_dt = to_dat.toISOString();

var oFilter = new sap.ui.model.Filter("CreatedAt",sap.ui.model.FilterOperator.BT,from_dt,to_dt);

filters.push(oFilter);

var list = this.getView().byId("list");

var oBinding = list.bindAggregation("items");

oBinding.oFilter(filters); } },

SAPUI5

I can not filter a list in a date range.

My list (example of date on my list 05/11/2014)

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

2 Answers

avatar image
Former Member Oct 25, 2017 at 06:39 AM
0

Hi Thairi,

can you please check where you have defined from_dt which you have used to filter.

here i can see only to_dt is defined.

var to_dt = to_dat.toISOString();

var oFilter = new sap.ui.model.Filter("CreatedAt",sap.ui.model.FilterOperator.BT,from_dt,to_dt);

Share
10 |10000 characters needed characters left characters exceeded
Tri Minh Le Oct 24, 2017 at 10:24 PM
0

Hi ITHRI,

Could you please open the console in the browser and check if any errors return or not?

Thanks

Tri

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

"CreatedAt": "05/11/2014"

sapui5.jpg (102.3 kB)
0

Line 68. Could you please change list.getBinding("items") and run again?

And I have the same question like Navatha raised above.

Thanks

Tri

0