DataTable Server侧排序日期按年份>月份>日期

时间:2018-06-15 11:37:32

标签: sorting datatable

有一种方法可以Year -> Month -> Day"order": [[ 0, "asc" ]],排序日期Year -> Month -> Day它工作得很好但我怎么能这样做var lead_birth_dt = $('#lead-birthday-table').DataTable({ processing: true, language: { processing: '<div class="loading-chart" style="background: #ececec00l; margin-bottom: 10px;"><img src="{{asset('assets/images/chart-loading.webp')}}"></div>', }, serverSide: true, select: true, responsive: true, "order": [[ 0, "asc" ]], ajax: '{{ url("/date") }}', columns: [ { data: 'birthdate', name: 'birthdate', className: 'text-center', render: function(data){ return ( moment(data, 'DD/MM/YYYY').format('ll') ); }, }, ], });

this.matIconRegistry.addSvgIcon(
  "icon1",
  this.domSanitizer.bypassSecurityTrustResourceUrl("../assets/images/icon1.svg")
);
this.matIconRegistry.addSvgIcon(
  "icon2",
  this.domSanitizer.bypassSecurityTrustResourceUrl("../assets/images/icon2.svg")
);

E.g数据 enter image description here

0 个答案:

没有答案