Antt Antt - 1 day ago 5
AngularJS Question

angular-datatables not sorting when formatting date

I have an issue in sorting date with angular-datables plugins when I want to format them.
Let me explain :
When I'm using

<td>{{date}}</td>


The result is :

enter image description here

When I'm using :

{{date | date}}


The result is :

enter image description here

But when I'm using :

{{date | date : 'dd/MM/yyyy'}}


The result is :

enter image description here

Even so I declared it as a date format :

_this.dtColumnDefs = [
DTColumnDefBuilder.newColumnDef(0).
.withOption('type', 'date')
];


Any ideas what i'm doing wrong ? Thanks

Answer

Finally I used something similar from your answer provided directly from DataTables : https://datatables.net/plug-ins/sorting/date-eu

The plugin is deprecated but is working well for what I want.

Comments