Sorting by human readable dates
Sorting by human readable dates
![nickdavies791](https://secure.gravatar.com/avatar/481b5945edec2ea401473d18dda46c5e/?default=https%3A%2F%2Fvanillicon.com%2F481b5945edec2ea401473d18dda46c5e_200.png&rating=g&size=120)
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