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

Content deleted Content added
No edit summary
tweak to ordinals (and dates with leading zeros)
Line 171:
 
//remove unlinked ordinal date formats
ohc_regex(/(\W)@DayDD@th?, @DayDD@th?(\s(?:and|&|to|or)\s)@DayDD@th?(?:\sof\s?)?(?:[ ]| )@Month(?=\W)/gi, '$1@DD1Day1, @DD2Day2$2@DD3Day3 @LMonth');
ohc_regex(/(\W)@DD@th?(\s(?:and|&|to|or)\s)@DD@th?(?:\sof\s?)?(?:[ ]| )@Month(?=\W)/gi, '$1@DD1Day1$2@DD2Day2 @LMonth');
ohc_regex(/(\W)(?:the |)@DD@th?(?:\sof)\s@Month,? @YYYY(?=\W\D)/gi, '$1@Day @LMonth @YYYY');
ohc_regex(/(\W)(?:the |)@DD@th?(?:\sof)\s@Month(?=\W\D)/gi, '$1@Day @LMonth');
ohc_regex(/(\W)@Day(?:\sof|)(?:[ _]| )@Month(?=[^\|\]\w\d])/gi, '$1@Day @LMonth');
ohc_regex(/(\W)@DD<sup>@th?<\/sup>(?:\sof\s?)?\s(@Month)(?=\W\D)/gi, '$1@Day @LMonth');
ohc_regex(/(\W)@Month\s(?:the\s)?@DayDD@th?,(?:\sthe\s)?(?: |&nbsp;)@DayDD@th?(\s(?:and|&|to|or)(?:[ _]|&nbsp;))(?:the\s)?@DayDD@th?(?=[^\]\|\w\d])/gi, '$1@LMonth @DD1Day1, @DD2Day2$2@DD3Day3');
ohc_regex(/(\W)(@month)\s(@day)((?:,\s@day){0,6}),?(\/|\s?[-–]\s?|\s(?:and|&|to|or)\s+?)@Day(?:,?(?:[ _]|&nbsp;)|\sof\s)?(\d{3,4}\W\D)/gi, '$1$2 $3$4$5@Day, $6');
ohc_regex(/(\W)@Month(?:[ ]|&nbsp;)(?:the\s)?@DayDD@th?(?=[^\]\|\w\d]\D)/gi, '$1@LMonth @DDDay');
ohc_regex(/(\W)@Month(?:[ ]|&nbsp;)(?:the\s)?@DD<sup>@th<\/sup>(?=[^\]\|\w\d]\D)/gi, '$1@LMonth @DDDay');
 
// eliminating time of day