Is it possible to make ascending order for dates go from newest dates to oldest dates?
Is it possible to make ascending order for dates go from newest dates to oldest dates?
santosh8887
Posts: 2Questions: 1Answers: 0
ex: After clicking on column header it should sort in ascending order(up arrow) with date form newest (13 Mar 2018) to oldest (05 Jan 2008).
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
See if this blog helps:
https://datatables.net/blog/2014-12-18
Kevin
@kthorngren Thanks for quick reply, I am already using Moment.js for date format like 05 Jan 2008. its sorting correctly by default ascending result is oldest date to newest and for descending newest to oldest but I need ascending result like newest (13 Mar 2018) to oldest (05 Jan 2008) and in descending result like oldest to newest dates.
Maybe you can use
columns.render
to provide the date in a format that thesort
operation can use (without the()
) as described here:https://datatables.net/manual/data/orthogonal-data
Kevin