How Angular orderBy with date string? I am trying to use the orderBy to sort a ng-repeat. Our data currently uses the valueList for the filter which isn't working.
I believe they are sorting alphanumerically rather than by date because my 'matchDate' field is a string. My question is, how to best convert this field to Date for proper ordering
$scope.valueList=
[
{
"_id" : ObjectId("5862c276d9913952fa80aa11"),
"matchDate" : "31 December, 2016",
"scoreStatus" : "OPEN"
},
{
"_id" : ObjectId("58679badd991390f83fbb994"),
"matchDate" : "30 December, 2016",
"scoreStatus" : "CLOSE"
},
{
"_id" : ObjectId("58679badd991390f83fbb994"),
"matchDate" : "28 December, 2016",
"scoreStatus" : "OPEN"
}
]
This is my html
<div ng-repeat="eachValue in valueList | orderBy: 'matchDate'">
{{eachValue.matchDate}}
</div>