I have e.g. an array like this:
var myArray = [];
var item1 = {
start: '08:00',
end: '09:30'
}
var item2 = {
start: '10:00',
end: '11:30'
}
var item3 = {
start: '12:00',
end: '14:30'
}
var item4 = {
start: '16:00',
end: '18:25'
}
var item5 = {
start: '19:00',
end: '21:25'
}
myArray.push(item1);
myArray.push(item2);
myArray.push(item3);
myArray.push(item4);
After sorting the order should look like this
[item1, item2, item5, item4, item3]
So the items with start- time before 12:00 should be ascending and the items with start time after or equal 12:00 sould be in reverse order.
I use AngularJS to iterate over the items:
<div ng-repeat="item in $scope.myArray" | orderBy:myOrderFunction? ...
and I would need the above order for ng-repeat. Is there a possibiliy to do this (in a performant way)?