[Resolved] sorting table like 10/10/2010 (day, month, year)

[Resolved] sorting table like 10/10/2010 (day, month, year)

surfwebbysurfwebby Posts: 11Questions: 2Answers: 0
edited November 2010 in General
Good evening.

I have a problem with the order of dates. I've watched a lot of answers but unfortunately I could not solve the problem.

I am Italian and use the data in this format: 10/10/2010 (day, month, year).

I tried using the plugin by Andy McMaster but the dates are not sorted correctly.

could you help me please? If you need more information ask me.

Enclosed is the code used:

[code]




$(document).ready(function() {
$('#myTable').dataTable( {
"aoColumns": [
{ "sSortDataType": 'uk_date' },
null,
null,
null
],
"bPaginate": false,
"bLengthChange": false,
"bFilter": false,
"bSort": true,
"bInfo": false,
"bAutoWidth": false } );
} );





Data




25/10/2006


04/10/2006


02/10/2006


07/02/2006


01/02/2006


28/01/2006


28/01/2006


28/01/2006


28/01/2006


28/01/2006


28/01/2006


28/01/2006


28/01/2006


28/01/2006


28/01/2006


28/01/2006


28/01/2006


28/01/2006


27/01/2006


21/01/2006


21/01/2006


12/01/2006




[/code]

PS: sorry for my bad English but not speak it very well!

Replies

  • surfwebbysurfwebby Posts: 11Questions: 2Answers: 0
    anyone can help me to solve this problem?
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Are you getting any Javascript errors in Firebug or anything? Also which version of DataTables are you using? Can you give a link so we can see this happening?

    Allan
  • surfwebbysurfwebby Posts: 11Questions: 2Answers: 0
    Hello Allan,

    thanks for reply.

    With javascript I just started so I can not help you with firebug. What I can do is give you a demo of the table at this address:

    http://demotable.dyndns.org/

    I hope it will be enough!

    PS: If need be I can give you ftp access to do the tests.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Thanks for the link - very helpful! use 'sType' rather than 'sSortDataType': http://datatables.net/usage/columns#sType . I hadn't really thought about the confusion in the naming there, but I certainly see it now! I've made a note for if and when DataTables 2 happens :-)

    Allan
  • surfwebbysurfwebby Posts: 11Questions: 2Answers: 0
    THANKS!!!!

    everything works!! :D
This discussion has been closed.