Date as text but still keep sorting

Date as text but still keep sorting

plawsplaws Posts: 3Questions: 2Answers: 0

Maybe I didn't search enough.

Is there a way to display today, yesterday and still have sorting?

Answers

  • kthorngrenkthorngren Posts: 14,171Questions: 25Answers: 3,343

    Are you saying you want a mixture of dates, ie, 09/05/2021 and today in the same column? Is the actual data for today a date but you want to display it with the word today instead? If you just want to display strings like today or yesterday in place of a date you can use orthogonal data for the display operation and return today for today's date or just return the date. Sorting will still be by the actual date.

    If this isn't what you want or it doesn't help please provide us with a simple test case showing an example of your data and a description of what you would like to happen.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

Sign In or Register to comment.