Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8635

Re: Date Column in the sap.ui.table.Table is not Sorting properly

$
0
0

Sorting and Filtering in JSON Models

 

 

var dateformat = sap.ui.core.format.DateFormat.getDateTimeInstance({

    pattern : "MM/dd/YYYY"

  }

 

var oSorter =newsap.ui.model.Sorter("Date");
oSorter
.fnCompare =function(value1, value2){


var date2 = dateformat.parse(value2);

var date1 = dateformat.parse(value1);

  

value1 = date1.getTime();

value2 = date2.getTime();


if(value1 < value2)return-1;
  
if(value1 == value2)return0;
  
if(value1 > value2)return1;


};


<TABLE>.getBinding("rows").aSorters.push(oSorter );


Viewing all articles
Browse latest Browse all 8635

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>