Sorting by human readable dates

Sorting by human readable dates

nickdavies791nickdavies791 Posts: 2Questions: 2Answers: 0
edited September 2018 in Free community support

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

Answers

  • allanallan Posts: 49,042Questions: 1Answers: 7,166 Site admin

    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

Sign In or Register to comment.