I try to angular table order By Date Column(descending order).But It doesn't work(Date Column data type is String,in some reason have to get String data type).Please help me.
Sample Data
Trans.Date | Receipt / Ref No | Trx Code | Description | Receipt Amt | Debit | Credit | Running Balance
2013-08-15 | 000000000001 | OST | OST | 0.00 | 150.00 | 0.00 | 150.00
2013-08-15 | 000000000001 | OTH | Amounts | 0.00 | 8,000.00 | 0.00 | 8,150.00
2013-09-15 | 000000000001 | RNT | Rental | 0.00 | 3,041.00 | 0.00 | 11,191.00
2013-10-15 | 000000000002 | RNT | Rental | 0.00 | 3,041.00 | 0.00 | 14,232.00
Code
<table id="tblTrans" class="display table-bordered" cellspacing="0" width="100%" style="font-size: small;">
<thead>
<tr>
<th>Date</th>
<th>Receipt / Ref No</th>
<th>Trx Code</th>
<th>Description</th>
<th>Pay Mode</th>
<th>Receipt Amt</th>
<th>Debit</th>
<th>Credit</th>
<th>Running Balance</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="objtrn in transactions | orderBy:'TRNDATE' | startFrom:currentPageTrn*pageSize | limitTo:pageSize ">
<td>{{objtrn.TRNDATE}}</td>
<td>{{objtrn.TRNNO}}</td>
<td>{{objtrn.TRNCODE}}</td>
<td>{{objtrn.DESCR}}</td>
<td>{{objtrn.PAYMODE}}</td>
<td style="text-align:right">{{objtrn.TRNAMT | number:2}}</td>
<td style="text-align:right">{{objtrn.DEBIT | number:2}}</td>
<td style="text-align:right">{{objtrn.CREDIT | number:2}}</td>
<td style="text-align:right">{{objtrn.RUNBAL | number:2}}</td>
</tr>
</tbody>
Use the reverse argument (see documentation)
The syntax is: orderBy : expression : reverse : comparator
In your case, change your filter to:
orderBy:'TRNDATE':true