Skip to content

Commit d2c6d57

Browse files
committed
shortDate detection update - fixes issue #76
1 parent 094e111 commit d2c6d57

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

js/jquery.tablesorter.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,8 @@
10411041
ts.addParser({
10421042
id: "shortDate", // "mmddyyyy", "ddmmyyyy" or "yyyymmdd"
10431043
is: function(s) {
1044-
// testing for ####-####-#### - so it's not perfect
1045-
return (/\d{1,4}[\/\-\,\.\s+]\d{1,4}[\/\-\.\,\s+]\d{1,4}/).test(s);
1044+
// testing for ####-##-#### - so it's not perfect
1045+
return (/^(\d{2}|\d{4})[\/\-\,\.\s+]\d{2}[\/\-\.\,\s+](\d{2}|\d{4})$/).test(s);
10461046
},
10471047
format: function(s, table, cell, cellIndex) {
10481048
var c = table.config, ci = c.headerList[cellIndex],

0 commit comments

Comments
 (0)