DataTables column sorting not working properly with ISO8601 dates

DataTables column sorting not working properly with ISO8601 dates

yetyet Posts: 43Questions: 17Answers: 1

See screenshot - there is a column "Datum" which should be sorted. The internal date format is ISO8601 (see data-order, data-sort attributes in debugger tools). I wonder the dates are obviously sorted by the rendered value instead of their internal iso8601
representation?

out.png 223.6K

Answers

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin

    Happy to take a look at a test case showing the issue. My guess is that you might be Ajax loading the table? In which case use columns.render to tell DataTables about the orthogonal data.

    Allan

  • yetyet Posts: 43Questions: 17Answers: 1

    No, the data is directly rendered into a table.

  • yetyet Posts: 43Questions: 17Answers: 1

    The custom render for the ISO8601 format is only called with type=filter and type=display.

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin

    I'm afraid there isn't much help I can offer without being able to debug it. Perhaps the debugger will give me the information needed, but I'm not certain.

    Allan

This discussion has been closed.