0

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?

Zvezdas1989
  • 1,445
  • 2
  • 16
  • 34

0 Answers0