Date sort doesn't work as it should

Date sort doesn't work as it should

d00dd00d Posts: 1Questions: 1Answers: 0

Hi,

I'm working with the latest DT and would like to have my table sortable by German date. The values look like that:

<td class="sorting_1">
       15.06.2020 09:07:44
</td>

I used **moment **for sorting. My code looks like this:

$.fn.dataTable.moment("dd.MM.YYYY HH:mm:ss");

$('#samIndexTable').DataTable({
    drawCallback: function () {
        var pagination = $(this).closest('.dataTables_wrapper').find('.dataTables_paginate');
        pagination.toggle(this.api().page.info().pages > 1);
    },
    "order": [[5, "desc"]],
    "pageLength": 25,
    "language":
    {
        "processing": loc_processing,
        "lengthMenu": loc_lengthMenu,
        "zeroRecords": loc_zeroRecords,
        "info": loc_info,
        "infoEmpty": loc_infoEmpty,
        "infoFiltered": loc_infoFiltered,
        "search": loc_search,
        "next": loc_next,
        "paginate": {
            "previous": loc_previous,
            "next": loc_next,
        }
    }
});

This is the result. The two entries with may thould be at the end of the list.

Any idea where I went wrong?

Answers

This discussion has been closed.