I Have a jquery datatable where date column format is Feb 16, 2018 but when it is sorted it is not getting sorted correctly.
I have used all date related column types mentioned Here
But Nothing seems to work. How can I resolve it?
Here is the code
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="panel-body btnsize">
<table class="table table-striped table-bordered dttable" id="JsDataTable" style="border-radius: 17px 17px 0 0; border-style: solid; border-color: #fcfdfa;" width:100%;>
<thead>
<tr>
<th style="width: 1px !important;" class="tblth">
Sr
</th>
<th class="tblth" style="width:13% !important;">
Date <i class="fa fa-fw fa-sort"></i>
</th>
</tr>
</thead>
<tbody class="dtbody tblth" style="color: #004D6B;">
</tbody>
</table>
</div>
var table = $("#JsDataTable").DataTable({
scrollY: '50vh',
scrollCollapse: true,
"aaData": response,
"pagingType": "full_numbers",
"dom": '<"top"i>rt<"bottom"flp><"clear">',
"sDom": 'Rfrtlip',
"bInfo": true,
"lengthMenu": [
[10, 20, 30, -1],
[10, 20, 30, "All"]
],
"columnDefs": [{
"searchable": false,
"orderable": false,
"targets": [0, 1, 2, 3, 4],
"type": 'natural'
}],
"order": [
[1, 'asc']
],
"aoColumns": [{
"mData": null
},
{
"mData": "Date",
'bSortable': true,
"sType": "natural"
},
],
"searching": true,
"paging": true,
"bAutoWidth": false,
"fixedColumns": false,
//order: [],
});