shortDate detection update - fixes issue #76

This commit is contained in:
Rob Garrison 2012-05-23 15:37:47 -05:00
parent 094e1116ad
commit d2c6d5786a

View File

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