The data I receive from the web service is formatted as dd / mm / yyyy. The problem with this is sorting, it is sorted by dd, not yyyy.
<td ng-repeat="thead in resultHeader">
<a href="" ng-click="order(thead.line)">{{thead.head}}</a>
<span class="sortorder" ng-show="predicate === thead.line" ng-class="{reverse:reverse}"></span>
</td>
Controller:
$scope.order = function(predicate) {
var results = $scope.model.resultList;
$scope.reverse = ($scope.predicate === predicate) ? !$scope.reverse : false;
$scope.predicate = predicate;
$scope.model.currentPage = 1;
$scope.model.beginFrom = 0;
};
How can I sort this data by yyyy with my current setting?
{
"name": "Test",
"ShipmentDate": "06\/08\/2012"
}
source
share