Column sort by German date 20.04.2014

Column sort by German date 20.04.2014

hawkmasterhawkmaster Posts: 56Questions: 20Answers: 0
edited April 2014 in General
Hello
I would like to show a german date in a second column. The date is shown in a German format with dots.
I have aaSorting like this;

"aaSorting": [[ 1, "desc" ]],

but the date is not sorted correct.
30.04.2014
22.04.2014
21.02.2014
20.04.2014
20.03.2014

I have seen that there is a parameter "sType", I tried is like this:

{ "mData": "projectday",
"sWidth": 80,
"sType": "date"
},

But the sort order is still not correct.

thanks for any help

best regards
Hawk

Replies

  • wcmaneswcmanes Posts: 19Questions: 1Answers: 0
    Columns that don't sort easily can be handled very simply. Use HTML sorting and precede the displayed data with invisible "sorting data", i.e. ...
    [code]
    ...2014-04-2222.04.2014...
    ...2014-04-3030.04.2014...
    [/code]
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    If you set sType you need to set it to a type that you have added as a plug-in for your date format. There are a number of pre-built sorting plug-ins available here - including one that will operate on your data type: http://datatables.net/plug-ins/sorting

    Allan
This discussion has been closed.