Content deleted Content added
Ohconfucius (talk | contribs) edit summary |
Ohconfucius (talk | contribs) No edit summary |
||
Line 11:
// resolvable ambiguous date formats
//4-digit year universal
txt.value=txt.value.replace(/([^\d])\s0?1\/0?1\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?2\/0?2\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?3\/0?3\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?4\/0?4\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?5\/0?5\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?6\/0?6\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?7\/0?7\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?8\/0?8\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?9\/0?9\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s10\/10\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s11\/11\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s12\/12\/([12]\d{
//4-digit year UK style
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?1\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?2\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?3\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?4\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?5\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?6\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?7\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?8\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?9\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/10\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/11\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/12\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?1\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?2\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?3\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?4\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?5\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?6\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?7\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?8\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?9\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/10\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/11\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/12\/([12]\d{
//4-digit year US style
txt.value=txt.value.replace(/([^\w\d-])0?1\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?2\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?3\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?4\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?5\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?6\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?7\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?8\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?9\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])10\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])11\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])12\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?1\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?2\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?3\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?4\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?5\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?6\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?7\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?8\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?9\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])10\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])11\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])12\/(1[3-9])\/([12]\d{
//2-digit year ('00-'19) universal
Line 209:
//universal
txt.value=txt.value.replace(/([^\d])\s0?1\/0?1\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?2\/0?2\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?3\/0?3\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?4\/0?4\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?5\/0?5\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?6\/0?6\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?7\/0?7\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?8\/0?8\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s0?9\/0?9\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s10\/10\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s11\/11\/([12]\d{
txt.value=txt.value.replace(/([^\d])\s12\/12\/([12]\d{
//UK style
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?1\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?2\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?3\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?4\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?5\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?6\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?7\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?8\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/0?9\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/10\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/11\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][23]\d)\/12\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?1\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?2\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?3\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?4\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?5\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?6\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?7\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?8\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/0?9\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/10\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/11\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-]1[3-9])\/12\/([12]\d{
//US style
txt.value=txt.value.replace(/([^\w\d-])0?1\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?2\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?3\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?4\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?5\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?6\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?7\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?8\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?9\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])10\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])11\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])12\/([23]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?1\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?2\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?3\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?4\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?5\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?6\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?7\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?8\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?9\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])10\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])11\/(1[3-9])\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])12\/(1[3-9])\/([12]\d{
Line 294:
//4-digit year US style
txt.value=txt.value.replace(/([^\w\d-])0?1\/([0-3]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?2\/([0-3]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?3\/([0-3]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?4\/([0-3]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?5\/([0-3]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?6\/([0-3]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?7\/([0-3]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?8\/([0-3]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])0?9\/([0-3]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])10\/([0-3]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])11\/([0-3]\d)\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-])12\/([0-3]\d)\/([12]\d{
//2-digit year ('00-'19) US style
Line 353:
// resolvable ambiguous date formats
//4-digit year UK style
txt.value=txt.value.replace(/([^\w\d-][0-3]\d)\/0?1\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][0-3]\d)\/0?2\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][0-3]\d)\/0?3\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][0-3]\d)\/0?4\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][0-3]\d)\/0?5\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][0-3]\d)\/0?6\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][0-3]\d)\/0?7\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][0-3]\d)\/0?8\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][0-3]\d)\/0?9\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][0-3]\d)\/10\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][0-3]\d)\/11\/([12]\d{
txt.value=txt.value.replace(/([^\w\d-][0-3]\d)\/12\/([12]\d{
//2-digit year ('00-'19) UK style
Line 499:
Ohc_fix_common_errors();
//delink ISO8601 dates
txt.value=txt.value.replace(/\[\[([12]\d{
txt.value=txt.value.replace(/\[\[([12]\d{
txt.value=txt.value.replace(/([12]\d{
txt.value=txt.value.replace(/\[\[([12]\d{
//delink full dates
txt.value=txt.value.replace(/\[\[([1-3]?\d)(?:th|st|nd|rd|)[\s_](?:of[\s_])?(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.?|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))(?:\]\] \[\[| )([12]\d{
txt.value=txt.value.replace(/\[\[(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.?|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|)) (?:the\s)?([1-3]?\d)(?:th|st|nd|rd|)(?:\]\],? \[\[|, )([12]\d{
//delink single dm or 'dth the m'
Line 596:
txt.value = yyyymmdd_to_dmy(txt.value); // adapted from User:Plastikspork/datetools.js
txt.value=txt.value.replace(/([^\d\w\/\-%,])([12]\d{
//code to convert ref ISO-dates outside citation templates
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
Ohc_remove_leading_zeros_from_nonlinked_dates ();
Line 636:
//code to convert ref ISO-dates outside citation templates
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
txt.value=txt.value.replace(/(<\s?ref.*?>[^<]+?)([\s\(])([12]\d{
Ohc_remove_leading_zeros_from_nonlinked_dates ();
Line 713:
var txt=document.editform.wpTextbox1;
//remove leading zero from nonlinked date
txt.value=txt.value.replace(/([^\d][^\w\d])(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s0(\d)(?:th|st|nd|rd|),?\s([12]\d{
txt.value=txt.value.replace(/([^\d][^\w\d])0(\d)(?:th|st|nd|rd|)\s(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s([12]\d{
txt.value=txt.value.replace(/([^\d][^\w\d])(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s0(\d)(?:th|st|nd|rd|)([^\w\d][^\d]|[ ]*\r)/gi, '$1$2 $3$4');
|