Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82440

Sorting US Date and 4 character Alphanumeric numbering

$
0
0
Hi I have two issues.

Hi I have two issues,

Issue #1

I would like to do a simple sort on US date mm/dd/yyyy in descending order. I have a dataTable of 4 columns and would like to sort by dueDate. Below is my jquery javascript. But its only sorting by British date which is what I am thinking

$('#ticket-table').dataTable({

"bPaginate": false,
"bLengthChange": false,
"bFilter": false,
"bSort": true,
"bInfo": false,
"bAutoWidth": false,
"aaSorting": [[ 1, "desc" ]],

"aoColumnDefs" : [{bSortable : false, "sType": "date", aTargets: [ 0,2,3 ]}]




});


Issue #2

I would like to do a simple sort on a 4 character alphanumeric string FCC100 to FCC1 in descending order. The problem it sorts on single digits then double digits. For example I get the sort output as

FCC9
FCC8
FCC7
FCC6
FCC5
FCC4
FCC3
FCC2
FCC38
FCC37
FCC36
FCC35
FCC1

I would like it to be sorted:

FCC38
FCC37
FCC36
FCC35
FCC9
FCC8
FCC7
FCC6
FCC5
etc.

Please see my script:
$('#fccData').dataTable({

"bPaginate": false,
"bLengthChange": false,
"bFilter": false,
"bSort": true,
"bInfo": false,
"bAutoWidth": false,
"aaSorting": [[ 2, "desc" ]],
"aoColumnDefs" : [{bSortable : false, aTargets: [0,1,3,4,5 ]}, {sType:"numeric", "aTargets": [2]}]

});





Please let me know what i am doing wrong.

Viewing all articles
Browse latest Browse all 82440

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>