Я нашел тип только для числового и текстового. Возможно, я ошибаюсь, но я придерживаюсь числа и отказываюсь от изменения его на сегодняшний день.
Код здесь, и он работает для меня.
$.tablesorter.addParser({
// set a unique id
id: 'term',
is: function(s) {
// return false so this parser is not auto detected
return false;
},
format: function(s) {
// format your data for normalization
text = s.split(' ');
s=text[1] + text[0];
return s.toLowerCase()
.replace(/wint/, 1)
.replace(/sumr/, 7)
.replace(/spr/, 3)
.replace(/fall/, 9);
},
// set type, either numeric or text
type: 'numeric'
});
$(".tablesorter").tablesorter({
headers: {
1: { sorter: "term" }
}
}
);
Спасибо!