date-dd-MMM-yyyy not working?
date-dd-MMM-yyyy not working?
Hi Allan & Esteemed Forum Colleagues,
This one seems trivial, except for the part where it's not working, lol! We're using 1.10.2 (and I also tried 1.10.4 for grins) and trying to get a dd-MMM-yyyy date to sort correctly, using datatables as a client-side wrapper for a table. No matter what I do, it is only sorting as a string, unusable..
I've tried with and without the date-dd-MMM-yyyy.js, same response; Can someone confirm or deny this functionality, and an example would be quite nice as well, my code is simple enough:
$(document).ready(function() {
$('#questionTable').dataTable({
"autoWidth": false,
"paging": true,
"ordering": true,
"order": [],
"info": true,
"filter": true,
"pageLength": 10,
"scrollY": 427,
"scrollX": true,
"columnDefs": [
{ "type": "date-dd-MMM-yyyy", targets: [7, 8] }
]
});
});
Answers
I've just put together a little example that uses the Date (dd-mmm-yyyy) plug-in and it seems to work as expected.
Are you able to link me to your page, or to a test page showing the issue?
One thing to note - with that plug-in, since it has a type-detection plug-in as well, there shouldn't be any need to specify the
columns.type
option. If it isn't automatically detected, then the data in the column isn't matching what is expected by the plug-in.Thanks,
Allan