angularjs - How to sort a table on basis of date of Birth when using angular js -
i want sort table on basis of date of birth. using angular js in code not working sorting date column if date string. using below code sorting-
<th> <a href="#" ng-click="sorttype = 'dob'; sortreverse = !sortreverse"> date of birth <span ng-show="sorttype == 'dob' && !sortreverse" class="glyphicon glyphicon-chevron-down"></span> <span ng-show="sorttype == 'dob' && sortreverse" class="glyphicon glyphicon-chevron-up"></span> </a> </th>
i have created plunker here- https://plnkr.co/edit/6jx3lnqh6jvo6u00qvvk?p=preview
can 1 tell me how can achieve that?
you should define date of births date objects, , use formatters display correct format in view
"dob": new date(1980, 0, 12)
Comments
Post a Comment