I fixed it.
My mistake was to use the $.tablesorter.addParser
inside the $(document).ready(function()
function...
I just did it this way :
$.tablesorter.addParser({
id: "customDate",
is: function(s) {
return /^[0-9]{1,2} [a-zA-Z]+, [0-9]{1,2}:[0-9]{1,2}$/.test(s);
},
format: function(s) {
s = s.replace(/,/,"").replace(/:/," ");
s = s.replace(/January/,1).replace(/February/,2).replace(/March/,3).replace(/April/,4).replace(/May/,5).replace(/June/,6).replace(/Jully/,7).replace(/August/,8).replace(/September/,9).replace(/October/,10).replace(/November/,11).replace(/December/,12);
s = s.split(" ");
s = s[1]*1000000+s[0]*10000+s[2]*100+s[3];
return s;
},
type: "numeric"
});
$(document).ready(function() {
$('.tablesorter').tablesorter({
headers: {
1: {
sorter:'customDate'
}
}
});
});
and now it's working correctly !