Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

How order list di date get from object

$
0
0

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???


Viewing all articles
Browse latest Browse all 228595

Trending Articles



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