I am relatively new to AngularJS. Could use some help
I have a table with the following info
<table><tr><th><span ng-click="sortType = 'first_name'; sortReverse = !sortReverse">Referral Name</span></th><th><span ng-click="sortType = 'date'; sortReverse = !sortReverse">Referral Name</span></th></tr><tr ng-repeat="x in referral | orderBy:sortType:sortReverse"><td>name</td><td>date</td></tr>
</tabe>
And the js code is as follows (after the controller connections)
$scope.sortType = '';
$scope.sortReverse = false;
This works perfectly for ascending and descending when sorting the name.
Unfortunately it works similarly in the case of date too (it is sorting alphabetically, rather than by date).
The date format I am getting from the backend(python) is in this format:
i["date"] = i["date"].strftime("%B %d, %Y")
September 13, 2016 <-- this format
I understand the mistake I made, but I am not able to find the solution for it.
How can I sort by date?
Thanks in advance guys.