Knowledge

User:Alex 21/script-formatdates.js

Source 📝

58: 30:
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by
31:
others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes.
35:
to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the
36: 32: 68: 2132:"Update OriginalAirDate and/or AltDate to use correct formats per template documentation via ]." 105: 64: 519:/(\|\s*(AltDate|FirstEngAirDate)_?\d?\s*=\s*)\{\{tart\sdate\|(\d+)\|0?(\d+)\|0?(\d+)(*)\}\}/ 8: 17: 80:
After saving, you have to bypass your browser's cache to see the changes.
104:
toolbar button. For details and instructions about other browsers, see
650:// Check for df and to see if the line actually needs changing at all 481:/(\|\s*(OriginalAirDate)_?\d?\s*=\s*)((*)\s*)?((\d{1,2}),\s*)?(\d{4})/ 500:/(\|\s*(OriginalAirDate)_?\d?\s*=\s*)((\d{1,2})\s*)?((*)\s*)?(\d{4})/ 408:// Df parameter, update parameters, months and regex used throughout 57: 1885:// Replace any occurences of {{Start date|}} and similar 24: 52: 26: 1195:"$ 1{{Start date|$ 7|$ 6|$ 4|df=y}}" 565:// Iterate through each line of the textbox 1704:"$ 1<<$ 4>> $ 5, $ 3" 1657:"$ 1$ 5 <<$ 4>> $ 3" 1118:"$ 1{{Start date|$ 7|$ 4|$ 6" 14: 1591:// Replace AltDate and FirstEngAirDate 67:seems to have a documentation page at 45:be executed when previewing this page. 1285:/(\|\s*(OriginalAirDate)\s*=\s*)(.*)/ 76: 23: 112: 2181: 1291:"$ 1{{Start date|$ 3}}" 56: 69:User:Alex 21/script-formatdates 13: 1: 7: 1037:// Replace OriginalAirDate 106:Knowledge:Bypass your cache 10: 2186: 1946:"{{Start date}}" 2166: 2165: 2153: 2152: 2146: 2145: 2139: 2138: 2105: 2104: 2101: 2100: 2079: 2078: 2012: 2011: 1993: 1992: 1986: 1985: 1982: 1981: 1975: 1974: 1959: 1958: 1889: 1888: 1882: 1881: 1878: 1877: 1871: 1870: 1825: 1824: 1773: 1772: 1766: 1765: 1759: 1758: 1743: 1742: 1718: 1717: 1711: 1710: 1677: 1676: 1664: 1663: 1630: 1629: 1611: 1610: 1595: 1594: 1588: 1587: 1584: 1583: 1577: 1576: 1531: 1530: 1488: 1487: 1442: 1441: 1396: 1395: 1341: 1340: 1334: 1333: 1327: 1326: 1311: 1310: 1298: 1297: 1264: 1263: 1209: 1208: 1202: 1201: 1168: 1167: 1155: 1154: 1091: 1090: 1060: 1059: 1041: 1040: 1034: 1033: 1030: 1029: 972:'FirstEngAirDate' 912:'OriginalAirDate' 891: 890: 866:'FirstEngAirDate' 776: 775: 751:'OriginalAirDate' 694: 693: 654: 653: 647: 646: 643: 642: 624: 623: 569: 568: 562: 561: 558: 557: 542: 541: 526: 525: 507: 506: 488: 487: 469: 468: 450: 449: 431: 430: 412: 411: 405: 404: 401: 400: 266:'Format airdates' 1242:"{{Start date" 364: 363: 333: 332: 326: 325: 310: 309: 273: 272: 224: 223: 160: 159: 141: 140: 116: 115: 113: 37:appropriate village pump 1769:// Numbers to months 1337:// Months to numbers 1858:">>" 1846:"<<" 803:'start date' 721:'start date' 675:/\|\s*df\s*\=\s*(+)/ 357:'wpTextbox1' 2120:'wpSummary' 2094:wpTextbox1NewValue 2060:wpTextbox1NewValue 1999:wpTextbox1NewValue 1005:'TableTBA' 100:key and click the 1314:OriginalAirDate_U 1133:"|df=y" 942:'AltDate' 836:'AltDate' 456:OriginalAirDate_U 329:// Textbox value 75: 74: 49: 48: 2177: 2171: 2170: 2164: 2163: 2160: 2157: 2151: 2150: 2144: 2143: 2137: 2136: 2133: 2130: 2127: 2124: 2121: 2118: 2115: 2112: 2109: 2103: 2099: 2098: 2095: 2092: 2089: 2086: 2083: 2077: 2076: 2073: 2070: 2067: 2064: 2061: 2058: 2055: 2052: 2049: 2046: 2043: 2040: 2037: 2034: 2031: 2028: 2025: 2022: 2019: 2016: 2010: 2009: 2006: 2003: 2000: 1997: 1991: 1990: 1989:// Save content 1984: 1980: 1979: 1973: 1972: 1969: 1966: 1963: 1957: 1956: 1953: 1950: 1947: 1944: 1941: 1938: 1935: 1932: 1929: 1926: 1923: 1920: 1917: 1914: 1911: 1908: 1905: 1902: 1899: 1896: 1893: 1887: 1886: 1880: 1876: 1875: 1869: 1868: 1865: 1862: 1859: 1856: 1853: 1850: 1847: 1844: 1841: 1838: 1835: 1832: 1829: 1823: 1822: 1819: 1816: 1813: 1810: 1807: 1804: 1801: 1798: 1795: 1792: 1789: 1786: 1783: 1780: 1777: 1771: 1770: 1764: 1763: 1757: 1756: 1753: 1750: 1747: 1741: 1740: 1737: 1734: 1731: 1728: 1725: 1722: 1716: 1715: 1709: 1708: 1705: 1702: 1699: 1696: 1693: 1690: 1687: 1684: 1681: 1675: 1674: 1671: 1668: 1662: 1661: 1658: 1655: 1652: 1649: 1646: 1643: 1640: 1637: 1634: 1628: 1627: 1624: 1621: 1618: 1615: 1609: 1608: 1605: 1602: 1599: 1593: 1592: 1586: 1582: 1581: 1575: 1574: 1571: 1568: 1565: 1562: 1559: 1556: 1553: 1550: 1547: 1544: 1541: 1538: 1535: 1529: 1528: 1525: 1522: 1519: 1516: 1513: 1510: 1507: 1504: 1501: 1498: 1495: 1492: 1486: 1485: 1482: 1479: 1476: 1473: 1470: 1467: 1464: 1461: 1458: 1455: 1452: 1449: 1446: 1440: 1439: 1436: 1433: 1430: 1427: 1424: 1421: 1418: 1415: 1412: 1409: 1406: 1403: 1400: 1394: 1393: 1390: 1387: 1384: 1381: 1378: 1375: 1372: 1369: 1366: 1363: 1360: 1357: 1354: 1351: 1348: 1345: 1339: 1338: 1332: 1331: 1325: 1324: 1321: 1318: 1315: 1309: 1308: 1305: 1302: 1296: 1295: 1292: 1289: 1286: 1283: 1280: 1277: 1274: 1271: 1268: 1262: 1261: 1258: 1255: 1252: 1249: 1246: 1243: 1240: 1237: 1234: 1231: 1228: 1225: 1222: 1219: 1216: 1213: 1207: 1206: 1200: 1199: 1196: 1193: 1190: 1187: 1184: 1181: 1178: 1175: 1172: 1166: 1165: 1162: 1159: 1153: 1152: 1149: 1146: 1143: 1140: 1137: 1134: 1131: 1128: 1125: 1122: 1119: 1116: 1113: 1110: 1107: 1104: 1101: 1098: 1095: 1089: 1088: 1085: 1082: 1079: 1076: 1073: 1070: 1067: 1064: 1058: 1057: 1054: 1051: 1048: 1045: 1039: 1038: 1032: 1028: 1027: 1024: 1021: 1018: 1015: 1012: 1009: 1006: 1003: 1000: 997: 994: 991: 988: 985: 982: 979: 976: 973: 970: 967: 964: 961: 958: 955: 952: 949: 946: 943: 940: 937: 934: 931: 928: 925: 922: 919: 916: 913: 910: 907: 904: 901: 898: 895: 889: 888: 885: 882: 879: 876: 873: 870: 867: 864: 861: 858: 855: 852: 849: 846: 843: 840: 837: 834: 831: 828: 825: 822: 819: 816: 813: 810: 807: 804: 801: 798: 795: 792: 789: 786: 783: 780: 774: 773: 770: 767: 764: 761: 758: 755: 752: 749: 746: 743: 740: 737: 734: 731: 728: 725: 722: 719: 716: 713: 710: 707: 704: 701: 698: 692: 691: 688: 685: 682: 679: 676: 673: 670: 667: 664: 661: 658: 652: 651: 645: 641: 640: 637: 634: 631: 628: 622: 621: 618: 615: 612: 609: 606: 603: 600: 597: 594: 591: 588: 585: 582: 579: 576: 573: 567: 566: 560: 556: 555: 552: 549: 546: 540: 539: 536: 533: 530: 524: 523: 520: 517: 514: 511: 505: 504: 501: 498: 495: 492: 486: 485: 482: 479: 476: 473: 467: 466: 463: 460: 457: 454: 448: 447: 444: 441: 438: 435: 429: 428: 425: 422: 419: 416: 410: 409: 403: 399: 398: 395: 392: 389: 386: 383: 380: 377: 374: 371: 368: 362: 361: 358: 355: 352: 349: 346: 343: 340: 337: 331: 330: 324: 323: 320: 317: 314: 308: 307: 304: 301: 298: 295: 292: 289: 286: 283: 280: 277: 271: 270: 267: 264: 261: 258: 255: 252: 249: 246: 243: 240: 237: 234: 231: 228: 222: 221: 218: 215: 212: 209: 206: 203: 200: 197: 194: 191: 188: 185: 182: 179: 176: 173: 170: 167: 164: 158: 157: 154: 151: 148: 145: 139: 138: 135: 132: 129: 126: 123: 120: 109: 96:: Hold down the 60: 53: 27: 2185: 2184: 2180: 2179: 2178: 2176: 2175: 2174: 2173: 2172: 2168: 2161: 2158: 2155: 2148: 2141: 2134: 2131: 2128: 2125: 2122: 2119: 2116: 2113: 2110: 2107: 2096: 2093: 2090: 2087: 2084: 2081: 2074: 2071: 2068: 2065: 2062: 2059: 2056: 2053: 2050: 2047: 2044: 2041: 2038: 2035: 2032: 2029: 2026: 2023: 2020: 2017: 2014: 2007: 2004: 2001: 1998: 1995: 1988: 1977: 1970: 1967: 1964: 1961: 1954: 1951: 1948: 1945: 1942: 1939: 1936: 1933: 1930: 1928:"|}}" 1927: 1924: 1921: 1918: 1915: 1912: 1909: 1906: 1903: 1900: 1897: 1894: 1891: 1884: 1873: 1866: 1863: 1860: 1857: 1854: 1851: 1848: 1845: 1842: 1839: 1836: 1833: 1830: 1827: 1820: 1817: 1814: 1811: 1808: 1805: 1802: 1799: 1796: 1793: 1790: 1787: 1784: 1781: 1778: 1775: 1768: 1761: 1754: 1751: 1748: 1745: 1738: 1735: 1732: 1729: 1726: 1723: 1720: 1713: 1706: 1703: 1700: 1697: 1694: 1691: 1688: 1685: 1682: 1679: 1672: 1669: 1666: 1659: 1656: 1653: 1650: 1647: 1644: 1641: 1638: 1635: 1632: 1625: 1622: 1619: 1616: 1613: 1606: 1603: 1600: 1597: 1590: 1579: 1572: 1569: 1566: 1563: 1560: 1557: 1554: 1551: 1548: 1545: 1542: 1539: 1536: 1533: 1526: 1523: 1520: 1518:"\\|" 1517: 1514: 1511: 1508: 1506:"\\|" 1505: 1502: 1499: 1496: 1493: 1490: 1483: 1480: 1477: 1474: 1471: 1468: 1465: 1462: 1459: 1456: 1453: 1450: 1447: 1444: 1437: 1434: 1431: 1429:"\\|" 1428: 1425: 1422: 1419: 1417:"\\|" 1416: 1413: 1410: 1407: 1404: 1401: 1398: 1391: 1388: 1385: 1382: 1379: 1376: 1373: 1370: 1367: 1364: 1361: 1358: 1355: 1352: 1349: 1346: 1343: 1336: 1329: 1322: 1319: 1316: 1313: 1306: 1303: 1300: 1293: 1290: 1287: 1284: 1281: 1278: 1275: 1272: 1269: 1266: 1259: 1256: 1253: 1250: 1247: 1244: 1241: 1238: 1235: 1232: 1229: 1226: 1223: 1220: 1217: 1214: 1211: 1204: 1197: 1194: 1191: 1188: 1185: 1182: 1179: 1176: 1173: 1170: 1163: 1160: 1157: 1150: 1147: 1144: 1141: 1138: 1135: 1132: 1129: 1126: 1123: 1120: 1117: 1114: 1111: 1108: 1105: 1102: 1099: 1096: 1093: 1086: 1083: 1080: 1077: 1074: 1071: 1068: 1065: 1062: 1055: 1052: 1049: 1046: 1043: 1036: 1025: 1022: 1019: 1016: 1013: 1010: 1007: 1004: 1001: 998: 995: 992: 989: 986: 983: 980: 977: 974: 971: 968: 965: 962: 959: 956: 953: 950: 947: 944: 941: 938: 935: 932: 929: 926: 923: 920: 917: 914: 911: 908: 905: 902: 899: 896: 893: 886: 883: 880: 877: 874: 871: 868: 865: 862: 859: 856: 853: 850: 847: 844: 841: 838: 835: 832: 829: 826: 823: 820: 817: 814: 811: 808: 805: 802: 799: 796: 793: 790: 787: 784: 781: 778: 771: 768: 765: 762: 759: 756: 753: 750: 747: 744: 741: 738: 735: 732: 729: 726: 723: 720: 717: 714: 711: 708: 705: 702: 699: 696: 689: 686: 683: 680: 677: 674: 671: 668: 665: 662: 659: 656: 649: 638: 635: 632: 629: 626: 619: 616: 613: 610: 607: 604: 601: 598: 595: 592: 589: 586: 583: 580: 577: 574: 571: 564: 553: 550: 547: 544: 537: 534: 531: 528: 521: 518: 515: 512: 509: 502: 499: 496: 493: 490: 483: 480: 477: 474: 471: 464: 461: 458: 455: 452: 445: 442: 439: 436: 433: 426: 423: 420: 417: 414: 407: 396: 393: 390: 387: 384: 381: 378: 375: 372: 369: 366: 359: 356: 353: 350: 347: 344: 341: 338: 335: 328: 321: 318: 315: 312: 305: 302: 299: 296: 293: 290: 287: 284: 281: 278: 275: 268: 265: 262: 259: 256: 253: 250: 247: 244: 241: 238: 235: 232: 229: 226: 219: 216: 213: 210: 207: 204: 201: 198: 195: 192: 189: 186: 183: 180: 177: 174: 171: 168: 165: 162: 155: 152: 149: 146: 143: 136: 133: 130: 127: 124: 121: 118: 111: 110: 99: 50: 40: 22: 21: 20: 12: 11: 5: 2183: 2114:getElementById 2072:"\n" 1934:"}}" 1148:"}}" 394:"\n" 351:getElementById 319:preventDefault 254:'p-tv' 248:addPortletLink 114: 97: 90:Microsoft Edge 73: 72: 61: 51: 47: 46: 25: 15: 9: 6: 4: 3: 2: 2182: 2167: 2154: 2147: 2140: 2106: 2102: 2080: 2013: 1994: 1987: 1983: 1976: 1960: 1890: 1883: 1879: 1872: 1826: 1774: 1767: 1760: 1744: 1719: 1712: 1678: 1665: 1631: 1612: 1596: 1589: 1585: 1578: 1570:"|" 1558:"|" 1532: 1524:"g" 1489: 1481:"|" 1469:"|" 1443: 1435:"g" 1397: 1342: 1335: 1328: 1312: 1299: 1265: 1210: 1203: 1169: 1156: 1092: 1061: 1042: 1035: 1031: 892: 777: 695: 655: 648: 644: 625: 570: 563: 559: 543: 527: 508: 489: 470: 451: 432: 413: 406: 402: 365: 334: 327: 311: 274: 225: 161: 142: 117: 107: 103: 95: 91: 87: 83: 82:Google Chrome 79: 70: 66: 62: 59: 55: 54: 44: 38: 34: 29: 28: 19: 2066:wpTextbox1_V 2039:wpTextbox1_V 1962:wpTextbox1_V 1952:"" 1512:months_short 1139:"" 636:wpTextbox1_V 599:wpTextbox1_V 548:months_short 370:wpTextbox1_V 101: 93: 89: 85: 81: 77: 42: 18:User:Alex 21 1916:'|' 791:toLowerCase 709:toLowerCase 282:portletlink 260:'#' 230:portletlink 65:user script 2082:wpTextbox1 2005:'' 1227:&& 957:&& 927:&& 818:&& 736:&& 376:wpTextbox1 339:wpTextbox1 144:setTimeout 41:This code 1746:AltDate_U 437:AltDate_U 2108:document 1910:/\|\|+/g 1727:line_old 1598:line_old 1218:line_old 1047:line_old 1023:continue 884:continue 769:continue 345:document 294:function 214:function 150:function 125:function 1940:replace 1922:replace 1904:replace 1840:replace 1692:replace 1645:replace 1546:replace 1457:replace 1279:replace 1236:indexOf 1183:replace 1106:replace 999:indexOf 966:indexOf 936:indexOf 906:indexOf 860:indexOf 830:indexOf 797:indexOf 745:indexOf 715:indexOf 98:⇧ Shift 86:Firefox 33:A guide 2045:length 1864:months 1806:length 1800:months 1698:ad_reg 1651:ad_reg 1500:RegExp 1423:months 1411:RegExp 1377:length 1371:months 605:length 532:months 513:ad_reg 181:loader 102:Reload 94:Safari 2126:value 2088:value 1075:match 669:match 462:false 443:false 424:false 388:split 382:value 288:click 202:ready 187:using 78:Note: 63:This 16:< 2036:< 1968:line 1898:line 1892:line 1834:line 1828:line 1797:< 1752:true 1733:line 1686:line 1680:line 1670:else 1639:line 1633:line 1604:line 1540:line 1534:line 1451:line 1445:line 1368:< 1320:true 1304:else 1273:line 1267:line 1230:line 1224:line 1177:line 1171:line 1161:else 1100:line 1094:line 1069:line 1053:line 1011:> 993:line 960:line 930:line 900:line 872:> 854:line 842:> 824:line 785:line 757:> 739:line 727:> 703:line 687:true 663:line 630:line 596:< 242:util 208:then 169:when 92:and 43:will 2169:}); 2159:200 2149:}); 2142:}); 2015:for 1996:var 1776:for 1497:new 1408:new 1399:var 1350:var 1344:for 1189:DMY 1112:MDY 1081:MDY 1044:var 794:(). 712:(). 627:var 578:var 572:for 545:var 529:var 510:var 494:DMY 491:var 475:MDY 472:var 453:var 434:var 415:var 367:var 336:var 322:(); 227:var 2162:); 2156:}, 2129:+= 2123:). 2063:+= 2054:++ 1955:); 1937:). 1919:). 1867:); 1815:++ 1730:!= 1721:if 1707:); 1660:); 1620:df 1614:if 1573:); 1552:re 1527:); 1491:re 1484:); 1463:re 1438:); 1402:re 1386:++ 1294:); 1248:== 1221:== 1212:if 1198:); 1151:); 1127:df 1084:)) 1063:if 990:|| 978:== 948:== 918:== 897:(( 894:if 881:)) 851:|| 809:== 779:if 697:if 681:df 678:)) 657:if 614:++ 418:df 397:); 360:); 285:). 276:$ 269:); 236:mw 217:() 205:). 196:$ 193:), 175:mw 163:$ 153:() 131:$ 119:$ 88:, 84:, 2135:; 2117:( 2111:. 2097:; 2091:= 2085:. 2075:; 2069:+ 2057:) 2051:i 2048:; 2042:. 2033:i 2030:; 2027:0 2024:= 2021:i 2018:( 2008:; 2002:= 1978:} 1971:; 1965:= 1949:, 1943:( 1931:, 1925:( 1913:, 1907:( 1901:. 1895:= 1874:} 1861:, 1855:+ 1852:j 1849:+ 1843:( 1837:. 1831:= 1821:{ 1818:) 1812:j 1809:; 1803:. 1794:j 1791:; 1788:1 1785:= 1782:j 1779:( 1762:} 1755:; 1749:= 1739:{ 1736:) 1724:( 1714:} 1701:, 1695:( 1689:. 1683:= 1673:{ 1667:} 1654:, 1648:( 1642:. 1636:= 1626:{ 1623:) 1617:( 1607:; 1601:= 1580:} 1567:+ 1564:j 1561:+ 1555:, 1549:( 1543:. 1537:= 1521:, 1515:+ 1509:+ 1503:( 1494:= 1478:+ 1475:j 1472:+ 1466:, 1460:( 1454:. 1448:= 1432:, 1426:+ 1420:+ 1414:( 1405:= 1392:{ 1389:) 1383:j 1380:; 1374:. 1365:j 1362:; 1359:1 1356:= 1353:j 1347:( 1330:} 1323:; 1317:= 1307:{ 1301:} 1288:, 1282:( 1276:. 1270:= 1260:{ 1257:) 1254:1 1251:- 1245:) 1239:( 1233:. 1215:( 1205:} 1192:, 1186:( 1180:. 1174:= 1164:{ 1158:} 1145:+ 1142:) 1136:: 1130:? 1124:( 1121:+ 1115:, 1109:( 1103:. 1097:= 1087:{ 1078:( 1072:. 1066:( 1056:; 1050:= 1026:; 1020:) 1017:1 1014:- 1008:) 1002:( 996:. 987:) 984:1 981:- 975:) 969:( 963:. 954:1 951:- 945:) 939:( 933:. 924:1 921:- 915:) 909:( 903:. 887:; 878:1 875:- 869:) 863:( 857:. 848:1 845:- 839:) 833:( 827:. 821:( 815:1 812:- 806:) 800:( 788:. 782:( 772:; 766:) 763:1 760:- 754:) 748:( 742:. 733:1 730:- 724:) 718:( 706:. 700:( 690:; 684:= 672:( 666:. 660:( 639:; 633:= 620:{ 617:) 611:i 608:; 602:. 593:i 590:; 587:0 584:= 581:i 575:( 554:; 551:= 538:; 535:= 522:; 516:= 503:; 497:= 484:; 478:= 465:; 459:= 446:; 440:= 427:; 421:= 391:( 385:. 379:. 373:= 354:( 348:. 342:= 316:. 313:e 306:{ 303:) 300:e 297:( 291:( 279:( 263:, 257:, 251:( 245:. 239:. 233:= 220:{ 211:( 199:. 190:( 184:. 178:. 172:( 166:. 156:{ 147:( 137:{ 134:) 128:( 122:( 108:. 71:. 39:.

Index

User:Alex 21
A guide
appropriate village pump

user script
User:Alex 21/script-formatdates
Knowledge:Bypass your cache






















Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.