Using Ultimate Date/Time Sort
Using Ultimate Date/Time Sort
akayaday
Posts: 3Questions: 1Answers: 0
I'm trying to implement the Ultimate Date/Time sort found here: http://www.datatables.net/blog/2014-12-18
However, I cannot get the column to read as a date. The main problem is that it goes from 1/1/2015 to 11/1/2015 and not to 2/1/2015. I think it is just reading the numbers and doing a sort that way. Is this because it is a string and not a date object? My limitation is that my data source only provides the date as a string.
Thanks!
akayaday
This discussion has been closed.
Answers
Sample code please.
$.fn.dataTable.moment('M/D/YYYY');
//DataTable
var table = $('#example').DataTable({
"scrollY": "500px",
"scrollX": true,
"scrollCollapse": true,
"paging": false,
"order": [[2, "desc"]]
});
Please reformat that code, per the instructions at the bottom of the screen.
Hi,
As far as I can see from the above, what you have looks to be correct. Could you link to a page showing the issue, or use the DataTables debugger so we can take a look and see what is going wrong please?
My guess is that there is something in the column that is making that column not valid for that date format (HTML tags for example, or a cell which is empty or has something other than that format in it), but it is impossible to say without a test case (which is noted in the forum rules :-) ).
Thanks,
Allan
Allan;
Unfortunately, the nature of the data and the site means I have to use a lot of discretion, but I think that the null objects in the column might have something to do with the issue. I'll check back soon!
akayaday