0

データを降順、つまり27,26,25でソートしたいのですがどうすればいいですか?Angularjsでdatetime ng-repeatを降順で並べ替える方法は?

<tbody class="gradeX" ng-repeat="x in Profile | orderBy: x.created_datetime"> 
    <tr> 
    <td>{{x.job_title }}</td> 
    <td>{{x.created_datetime | date:'medium' }}</td> 
    <td>{{x.updated_datetime | date:'medium' }}</td> 
    <td>{{x.status}}</td> 
    <td>{{ x.total }}</td> 
    <td class="actions"> <a href="" data-toggle="tooltip" title="Show Invoice Details" ng-click="activeinvoicesCtrl.setCurrentJob(x)"><i class="fa fa-server fa-2x" aria-hidden="true"></i></a> </td> 
    </tr> 
</tbody> 
+0

英語のように、文字列をCONCATし、コード – Mikkel

答えて

0

探しているプロパティの名前の文字列を追加します。 ネストされたプロパティの場合は、を使用します。初めに - 「item.created_datetime」

<tbody class="gradeX" ng-repeat="x in Profile | orderBy: '-created_datetime'"> 
+0

の書式設定は、私がトップ –

+0

上の最新の日付時刻が追加します。更新された回答を確認する –

0
<tbody class="gradeX" ng-repeat="x in Profile | orderBy: 'created_datetime'"> 
             <tr > 
              <td>{{x.job_title }}</td> 
              <td>{{x.created_datetime | date:'medium' }}</td> 
              <td>{{x.updated_datetime | date:'medium' }}</td> 
              <td>{{x.status}}</td> 
             <td >{{ x.total }}</td> 
             <td class="actions"> 
          <a href="" data-toggle="tooltip" title="Show Invoice Details" ng-click="activeinvoicesCtrl.setCurrentJob(x)"><i class="fa fa-server fa-2x" aria-hidden="true"></i></a> 

         </td>          
             </tr> 
            </tbody> 

あなたは2月1日は、1月2日の前にあるのを見て驚くかもしれませんされていない場合、あなたのcreated_datetimeオブジェクトはjavascriptの日付()オブジェクトであることを確認してください。

関連する問題