hi, i heve a list and i want ro order by clicking button by date. This date is taken from an object, i try this code, but it's sort like a simple number
// function to order and change button by click
$scope.sortType = "CreationDate";
$scope.sortReverse = false;
$scope.buttonStyle = "icon ion-ios-time-outline";
$scope.buttonPress = false;
$scope.ordina = function() {
if ($scope.sortType == "CreationDate") {
$scope.sortReverse = !$scope.sortReverse;
console.log("riordinate");
}
$scope.buttonPress = !$scope.buttonPress;
if ($scope.buttonPress == true) {
$scope.buttonStyle = "icon ion-ios-time";
} else {
$scope.buttonStyle = "icon ion-ios-time-outline";
}
}
in html
ion-item ng-repeat="object in allODA | filter: searchQuery | orderBy : sortType : sortReverse " href="#/app/ODA_Detail/{{object.caseTaskId}}"
any solutions???idea???