netnode IT services GmbH
Mythenstrasse 7
6003 Luzern
041 450 10 66
Kontaktformular
Newsletter [neu]
We once ecountered the problem to sort by european dates like "12.01.2008". This is not possible with tablesorter.js by default.
The following source is inspired by http://gist.github.com/17385.
Add this to the tablesorter.js
<?php
ts.addParser({
id: 'dates',
is: function(s) { return false },
format: function(s) {
if (s == 'n/a') {
return 0;
}
var dateArray = s.split('.');
return "20" + dateArray[2] + dateArray[1] + dateArray[0];
},
type: 'numeric'
});
?>