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) 

see https://plnkr.co/edit/1yupcexjb2dojintytds?p=preview


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -