Fix fuzzydate string matching logic

This commit is contained in:
Hugh Greenish 2017-08-17 16:59:17 +01:00
parent 5b67ac0806
commit f6981076ec
3 changed files with 6 additions and 6 deletions

@ -133,8 +133,8 @@ function fuzzydate(s/*:string*/)/*:Date*/ {
if(y < 0 || y > 8099) return n;
if((m > 0 || d > 1) && y != 101) return o;
if(s.toLowerCase().match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)) return o;
if(s.match(/[^-0-9:,\/\\]/)) return o;
return n;
if(s.match(/[^-0-9:,\/\\]/)) return n;
return o;
}
var safe_split_regex = "abacaba".split(/(:?b)/i).length == 5;

@ -1600,8 +1600,8 @@ function fuzzydate(s/*:string*/)/*:Date*/ {
if(y < 0 || y > 8099) return n;
if((m > 0 || d > 1) && y != 101) return o;
if(s.toLowerCase().match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)) return o;
if(s.match(/[^-0-9:,\/\\]/)) return o;
return n;
if(s.match(/[^-0-9:,\/\\]/)) return n;
return o;
}
var safe_split_regex = "abacaba".split(/(:?b)/i).length == 5;

@ -1537,8 +1537,8 @@ function fuzzydate(s) {
if(y < 0 || y > 8099) return n;
if((m > 0 || d > 1) && y != 101) return o;
if(s.toLowerCase().match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)) return o;
if(s.match(/[^-0-9:,\/\\]/)) return o;
return n;
if(s.match(/[^-0-9:,\/\\]/)) return n;
return o;
}
var safe_split_regex = "abacaba".split(/(:?b)/i).length == 5;