So i am getting data from my own server and i set the data to a variable called: items.
So whenever i do:
if (this.items) {
this.items.sort(function (a, b) {
return +new Date(b.datum) - +new Date(a.datum);
});
}
on windows and android it does sort my array but whenever i try this on a apple product like an iphone it doesn't sort on date so i seriously have no clue how?
new?b.datuma timestamp/number? Then you can and should justreturn b.datum - a.datum;or the other way around, depending on what you want to sort by. The "new Date" seems to make no sense to me, in addition to what @Jonathan said :/ Maybe the syntax is slightly wrong at the oment but some OS still accept it while other will not because of that slightly wrong syntax? Give it a try and report back.