I have an issue when I try to "order by" my date column of my table with the DataTable plugin.
I have setup my date format for it to appear like this : day of the week (full letter) day of the month (number) , month (number) and year (number)all in french .
In my code I have set it like this :
setlocale(LC_ALL, 'fr_FR');
...
...
<table class="table table-hover table-responsive display" id="table_1" >
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Titre</th>
<th scope="col">Prénom</th>
<th scope="col">Prospect créé le </th>
</tr>
</thead>
<tbody>
<?php
foreach($result as $key1){
?>
<tr>
<td scope="row"><?php echo $key1['ID']; ?></th>
<td><?php echo $key1['TITLE']; ?></td>
<td><?php echo $key1['NAME']; ?></td>
<td><?php $date_create=$key1['DATE_CREATE']; echo strftime("%A %e %B %Y à %H h %M ", strtotime($date_create)); ?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
So it appear like this in my table : https://i.ibb.co/KjH4ctk/Capture.png
but when I try to order by date with the datatable plugin, it order by the letter of the day of the week and not really by date.
here's my js file :
$(document).ready(function () {
$('#table_1').DataTable({
"destroy": true,
language: {
processing: "Traitement en cours...",
search: "Rechercher :",
lengthMenu: "Afficher _MENU_ éléments",
info: "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments",
infoEmpty: "Affichage de l'élement 0 à 0 sur 0 éléments",
infoFiltered: "(filtré de _MAX_ éléments au total)",
infoPostFix: "",
loadingRecords: "Chargement en cours...",
zeroRecords: "Aucun élément à afficher",
emptyTable: "Aucune donnée disponible dans le tableau",
paginate: {
first: "Premier",
previous: "Précédent",
next: "Suivant",
last: "Dernier"
},
aria: {
sortAscending: ": activer pour trier la colonne par ordre croissant",
sortDescending: ": activer pour trier la colonne par ordre décroissant"
}
}
});
});
Does someone know if there's a way to make it work properly ?
Regards,