jQuery テーブル ソーターで日付パターン 'yyyy-MM-dd hh:mm:ss.SSS' をソートできません。次のパーサーも試しました
ts.addParser({
id: "customDate",
is: function (s) {
//return false;
//use the above line if you don't want table sorter to auto detected this parser //else use the below line.
//attention: doesn't check for invalid stuff
//2009-77-77 77:77:77.000 would also be matched
//if that doesn't suit you alter the regex to be more restrictive
return /\d{1,4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}.\d{1,3}/.test(s);
},
format: function (s) {
s = s.replace(/\-/g, " ");
s = s.replace(/:/g, " ");
s = s.replace(/\./g, " ");
s = s.split(" ");
return $.tablesorter.formatFloat(new Date(s[0], s[1] - 1, s[2], s[3], s[4], s[5], s[6]).getTime() + parseInt(s[7]));
},
type: "numeric"
});
前もって感謝します。