Editor - issue with ordering of column with formatted dates

Editor - issue with ordering of column with formatted dates

steve@ditasolutions.comsteve@ditasolutions.com Posts: 4Questions: 2Answers: 0

Hi,
I'm using the Datatables Editor and am displaying a date in the format d/m/Y. I'm using the getFormatter() and setFormatter() (as per the examples) to signify the change between the mysql db format Y-m-d and the display format of d/m/Y and vice versa. The problem is that I'm also setting that column as the default order, and the date ordering is calculated on the display format which results in incorrect results. Is there a way to order a date column that isn't displayed in ISO8601 format?
Thanks

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,726Questions: 1Answers: 10,110 Site admin
    Answer ✓

    Hi,

    The date / time sorting plug-in introduced on this page is the best way of handling non-ISO8601 formatted dates with client-side processing.

    If you already have Moment.JS for the date / time picker loaded, that absolutely go for that method.

    Allan

  • steve@ditasolutions.comsteve@ditasolutions.com Posts: 4Questions: 2Answers: 0
    edited March 2017

    Great, thanks Allan

This discussion has been closed.