User:Ohconfucius/test/MOSNUM dates code.js: Difference between revisions

Content deleted Content added
link accessed
fixed false positives
Line 25:
 
// UK style
ohc_regex(/(\D[^\w\/-:\.])@DD[\/\.]@MM[\/\.]@YYNN(?=[^\w-–\/]\D)/gi, "$1@Day @Month @YYYY", function(d) {
if (d.d == d.m) return true;
if (d.d > 12) return true;
return false;
});
ohc_regex(/(\D[^\w\/-:♫])@DD\/@MM\/@YYNN(?=[^\w-–\/]\D)/gi, "$1@Day @Month @YYYY", function(d) {
if (d.d == d.m) return true;
if (d.d > 12) return true;
Line 32 ⟶ 37:
 
// US style
ohc_regex(/(\D[^\w\/-:\.])@MM[\/\.]@DD[\/\.]@YYNN(?=[^\w-–\/]\D)/gi, "$1@Month @Day, @YYYY", function(d) {
if (d.d > 12) return true;
return false;
});
ohc_regex(/(\D[^\w\/-:♫])@MM\/@DD\/@YYNN(?=[^\w-–\/]\D)/gi, "$1@Month @Day, @YYYY", function(d) {
if (d.d > 12) return true;
return false;
Line 376 ⟶ 385:
ohc_regex(/(\D\W)@Month((?:\s@day?,?){1,6}),?(\/|\s?(?:[-–]|–)\s?|(?:[ _]| )(?:and|&|to|or)(?:[ _]| )+?)@Day,?\s(?:of\s)?(@yyyy\W\D)/gi, "$1$2$3@Day @LMonth $4");
ohc_regex(/(\D\W)@Month((?:\s@day?,?){1,6}),?(\/|\s?(?:[-–]|–)\s?|(?:[ _]| )(?:and|&|to|or)(?:[ _]| )+?)@Day(?=\W\D)/gi, "$1$2$3@Day @LMonth");
ohc_regex(/(\D\W)@Month((?:\s@day?,?){1,6}),? @Day(?=\W\D)/gi, "$1$2, @Day @LMonth");
//'md, md,' to 'dm, dm,'