Sorting by human readable dates
Sorting by human readable dates
nickdavies791
Posts: 2Questions: 2Answers: 0
Is there a way to sort a column by a human readable date?
I use Laravel, and use the Carbon date package with the diffForHumans() method to convert my dates to human readable format i.e. 3 days ago, 5 minutes ago etc.
Datatables seems to sort numerically and alphabetically.
Example: https://screenshots.firefox.com/IYm9uC74bz0HaKq8/asset-manager.ngrok.io
This discussion has been closed.
Answers
This plug-in uses Moment for parsing date strings, which can parse that kind of information.
Although if you have the original unformatted date as well you should probably use orthogonal data.
Allan