datetime-moment ordering not working

datetime-moment ordering not working

simsek97simsek97 Posts: 7Questions: 3Answers: 0
edited October 2016 in DataTables 1.10

Hi everbody

i am trying to order date type column by using datetime-moment plugin. My workout is as below. (I ignored unnecessary parts)

<table id="myTable">
    <thead>
        <tr>
            <th>Name</th>
            <th class="sort-date">Birth Date</th>
        </tr>
    </thead>
</table>

<script type="text/javascript">

    $(function(){
        
        $.fn.dataTable.moment('MM.DD.YYYY');
        
        $('#myTable').dataTable({
            ajax: { 
                type: "POST", 
                url: "myUrl",
            },
            columns: [
                { data: "name", class: "text-center" },
                { data: "birthDate", class: "text-center" }
            ],
            columnDefs: [ 
                { type: "datetime-moment", targets: "sort-date" }
            ]
        });     
    });
    
</script>

But it does not work. Is there anything wrong?

I know the rules but sorry for that I can not give a test link since I am using it in a password protected area.

Thanks in advance.

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.