Date order in cascading filters
Date order in cascading filters
 silkspin            
            
                Posts: 154Questions: 35Answers: 5
silkspin            
            
                Posts: 154Questions: 35Answers: 5            
            I'm using moment.js to sort the dates in columns, but with cascading filters I don't know how to make the dates appear in the correct order for dd/mm/yyyy. I've tried a few things without success, but I think I'm on the right track http://live.datatables.net/jabihayo/1
I've added a conditional if (column.index() === 4) for the date column and I assume this is where I need moment to sort the date list as dates rather than a string?
This question has an accepted answers - jump to answer
Answers
Use something like the technique in this SO thread. The
sort()API takes a function which you can use to sort the date strings using moment.js. For example:http://live.datatables.net/cajazufe/1/edit
Kevin
Thank you @kthorngren. That's perfect!