In my project I want to sort date which is in dd-mm-yyyy format
. I tried like this below:
<script type="text/javascript">
$(document).ready(function() {
$('#myTable').dataTable( {
"order": [[ 3, "desc" ]],
"lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
"pageLength": 100
});
});
</script>
But this is not working. Here only date and month is getting sorted not also on the basis of year.
<?php echo date('m/d/y', strtotime($project->post_date)); ?>
Any Suggestions?