Changeset 8223 in josm
- Timestamp:
- 2015-04-18T17:25:14+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/validator/opening_hours.js
r7537 r8223 8 8 9 9 (function (root, factory) { 10 // constants (holidays, error correction) {{{ 11 // holidays {{{ 10 /* constants (holidays, error correction) {{{ */ 11 /* holidays {{{ */ 12 /* 13 * The country code keys and the PH, SH keys are surrounded by '': 14 * :%s/^\s\+\zs"\([^"]\+\)"\(: {\)/'\1'\2/ 15 * Fixed the indention with Vim Marco: 16 * /'PH'<cr>f{jVk%k,a: 17 * Fixed spacing in parenthesis: 18 * :%s/\[\zs\([^ ]\)/ \1/e | %s/\([^ ]\)\]/\1 \]/e | %s/,\([^ ]\)/, \1/e 19 */ 12 20 var holidays = { 13 21 'fr': { // {{{ 14 22 'PH': { // http://fr.wikipedia.org/wiki/F%C3%AAtes_et_jours_f%C3%A9ri%C3%A9s_en_France 15 "Jour de l'an" : [ 1, 1 ],16 "Vendredi saint" : [ 'easter', -2, [ 'Moselle', 'Bas-Rhin', 'Haut-Rhin', 'Guadeloupe', 'Martinique', 'Polynésie française' ] ],17 "Lundi de Pâques" : [ 'easter', 1 ],18 "Saint-Pierre-Chanel" : [ 4, 28, [ 'Wallis-et-Futuna' ] ],19 "Fête du Travail" : [ 5, 1 ],20 "Fête de la Victoire" : [ 5, 8 ],21 "Abolition de l'esclavage " : [ 5, 22, [ 'Martinique' ] ],22 "Abolition de l'esclavage " : [ 5, 27, [ 'Guadeloupe' ] ],23 "Jeudi de l'Ascension" : [ 'easter', 39 ],24 "Lundi de Pentecôte" : [ 'easter', 50 ],25 "Abolition de l'esclavage ": [ 6, 10, [ 'Guyane' ] ],26 "Fête de l'autonomie" : [ 6, 29, [ 'Polynésie française' ] ],27 "Fête nationale" : [ 7, 14 ],28 "Fête Victor Schoelcher" : [ 7, 21, [ 'Guadeloupe', 'Martinique' ] ],29 "Fête du Territoire" : [ 7, 29, [ 'Wallis-et-Futuna' ] ],30 "Assomption" : [ 8, 15 ],31 "Fête de la citoyenneté" : [ 9, 24, [ 'Nouvelle-Calédonie' ] ],32 "Toussaint" : [ 11, 1 ],33 "Armistice" : [ 11, 11 ],34 "Abolition de l'esclavage ": [ 12, 20, [ 'Réunion' ] ],35 "Noël" : [ 12, 25 ],36 "Saint-Étienne " : [ 12, 26, [ 'Moselle', 'Bas-Rhin', 'Haut-Rhin' ] ]23 "Jour de l'an" : [ 1, 1 ], 24 "Vendredi saint" : [ 'easter', -2, [ 'Moselle', 'Bas-Rhin', 'Haut-Rhin', 'Guadeloupe', 'Martinique', 'Polynésie française' ] ], 25 "Lundi de Pâques" : [ 'easter', 1 ], 26 "Saint-Pierre-Chanel" : [ 4, 28, [ 'Wallis-et-Futuna' ] ], 27 "Fête du Travail" : [ 5, 1 ], 28 "Fête de la Victoire" : [ 5, 8 ], 29 "Abolition de l'esclavage (Martinique)" : [ 5, 22, [ 'Martinique' ] ], 30 "Abolition de l'esclavage (Guadeloupe)" : [ 5, 27, [ 'Guadeloupe' ] ], 31 "Jeudi de l'Ascension" : [ 'easter', 39 ], 32 "Lundi de Pentecôte" : [ 'easter', 50 ], 33 "Abolition de l'esclavage (Guyane)" : [ 6, 10, [ 'Guyane' ] ], 34 "Fête de l'autonomie" : [ 6, 29, [ 'Polynésie française' ] ], 35 "Fête nationale" : [ 7, 14 ], 36 "Fête Victor Schoelcher" : [ 7, 21, [ 'Guadeloupe', 'Martinique' ] ], 37 "Fête du Territoire" : [ 7, 29, [ 'Wallis-et-Futuna' ] ], 38 "Assomption" : [ 8, 15 ], 39 "Fête de la citoyenneté" : [ 9, 24, [ 'Nouvelle-Calédonie' ] ], 40 "Toussaint" : [ 11, 1 ], 41 "Armistice" : [ 11, 11 ], 42 "Abolition de l'esclavage (Réunion)" : [ 12, 20, [ 'Réunion' ] ], 43 "Noël" : [ 12, 25 ], 44 "Saint-Étienne " : [ 12, 26, [ 'Moselle', 'Bas-Rhin', 'Haut-Rhin' ] ] 37 45 } 38 46 }, // }}} … … 1309 1317 }, 1310 1318 }, // }}} 1319 'ru': { // {{{ 1320 'PH': { // https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%A0%D0%BE%D1%81%D1%81%D0%B8%D0%B8 1321 "1. Новогодние каникулы": [ 1, 1 ], 1322 "2. Новогодние каникулы": [ 1, 2 ], 1323 "3. Новогодние каникулы": [ 1, 3 ], 1324 "4. Новогодние каникулы": [ 1, 4 ], 1325 "5. Новогодние каникулы": [ 1, 5 ], 1326 "6. Новогодние каникулы": [ 1, 6 ], 1327 "Рождество Христово": [ 1, 7 ], 1328 "8. Новогодние каникулы": [ 1, 8 ], 1329 "День защитника Отечества": [ 2, 23 ], 1330 "Международный женский день": [ 3, 8 ], 1331 "День Победы": [ 5, 9 ], 1332 "Праздник Весны и Труда": [ 5, 1 ], 1333 "День народного единства": [ 11, 4 ], 1334 "День России": [ 6, 12 ], 1335 }, 1336 'Tatarstan': { // https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%A2%D0%B0%D1%82%D0%B0%D1%80%D1%81%D1%82%D0%B0%D0%BD%D0%B0 1337 'PH': { 1338 "1. Новогодние каникулы": [ 1, 1 ], 1339 "2. Новогодние каникулы": [ 1, 2 ], 1340 "3. Новогодние каникулы": [ 1, 3 ], 1341 "4. Новогодние каникулы": [ 1, 4 ], 1342 "5. Новогодние каникулы": [ 1, 5 ], 1343 "6. Новогодние каникулы": [ 1, 6 ], 1344 "Рождество Христово": [ 1, 7 ], 1345 "8. Новогодние каникулы": [ 1, 8 ], 1346 "День защитника Отечества": [ 2, 23 ], 1347 "Международный женский день": [ 3, 8 ], 1348 "День Победы": [ 5, 9 ], 1349 "Праздник Весны и Труда": [ 5, 1 ], 1350 "День народного единства": [ 11, 4 ], 1351 "День России": [ 6, 12 ], 1352 // local 1353 "Ураза-байрам": [ 7, 28 ], 1354 "День Республики Татарстан": [ 8, 30 ], 1355 "Курбан-байрам": [ 10, 4 ], 1356 "День Конституции Республики Татарстан": [ 11, 6 ], 1357 }, 1358 }, 1359 'Bashkortostan': { // https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%91%D0%B0%D1%88%D0%BA%D0%BE%D1%80%D1%82%D0%BE%D1%81%D1%82%D0%B0%D0%BD%D0%B0 1360 'PH': { 1361 "1. Новогодние каникулы": [ 1, 1 ], 1362 "2. Новогодние каникулы": [ 1, 2 ], 1363 "3. Новогодние каникулы": [ 1, 3 ], 1364 "4. Новогодние каникулы": [ 1, 4 ], 1365 "5. Новогодние каникулы": [ 1, 5 ], 1366 "6. Новогодние каникулы": [ 1, 6 ], 1367 "Рождество Христово": [ 1, 7 ], 1368 "8. Новогодние каникулы": [ 1, 8 ], 1369 "День защитника Отечества": [ 2, 23 ], 1370 "Международный женский день": [ 3, 8 ], 1371 "День Победы": [ 5, 9 ], 1372 "Праздник Весны и Труда": [ 5, 1 ], 1373 "День народного единства": [ 11, 4 ], 1374 "День России": [ 6, 12 ], 1375 // local 1376 "Ураза-байрам": [ 7, 28 ], 1377 "Курбан-байрам": [ 10, 4 ], 1378 "День Республики Башкирии": [ 10, 11 ], 1379 "День Конституции Башкортостана": [ 12, 24 ], 1380 }, 1381 }, 1382 'Chuvashia': { 1383 'PH': { 1384 "1. Новогодние каникулы": [ 1, 1 ], 1385 "2. Новогодние каникулы": [ 1, 2 ], 1386 "3. Новогодние каникулы": [ 1, 3 ], 1387 "4. Новогодние каникулы": [ 1, 4 ], 1388 "5. Новогодние каникулы": [ 1, 5 ], 1389 "6. Новогодние каникулы": [ 1, 6 ], 1390 "Рождество Христово": [ 1, 7 ], 1391 "8. Новогодние каникулы": [ 1, 8 ], 1392 "День защитника Отечества": [ 2, 23 ], 1393 "Международный женский день": [ 3, 8 ], 1394 "День Победы": [ 5, 9 ], 1395 "Праздник Весны и Труда": [ 5, 1 ], 1396 "День народного единства": [ 11, 4 ], 1397 "День России": [ 6, 12 ], 1398 // local 1399 "День Чувашской республики": [ 6, 24 ], 1400 }, 1401 }, 1402 'Sakha Republic': { // https://ru.wikipedia.org/wiki/%D0%AF%D0%BA%D1%83%D1%82%D0%B8%D1%8F#.D0.9F.D1.80.D0.B0.D0.B7.D0.B4.D0.BD.D0.B8.D0.BA.D0.B8_.D0.AF.D0.BA.D1.83.D1.82.D0.B8.D0.B8 1403 'PH': { 1404 "1. Новогодние каникулы": [ 1, 1 ], 1405 "2. Новогодние каникулы": [ 1, 2 ], 1406 "3. Новогодние каникулы": [ 1, 3 ], 1407 "4. Новогодние каникулы": [ 1, 4 ], 1408 "5. Новогодние каникулы": [ 1, 5 ], 1409 "6. Новогодние каникулы": [ 1, 6 ], 1410 "Рождество Христово": [ 1, 7 ], 1411 "8. Новогодние каникулы": [ 1, 8 ], 1412 "День защитника Отечества": [ 2, 23 ], 1413 "Международный женский день": [ 3, 8 ], 1414 "День Победы": [ 5, 9 ], 1415 "Праздник Весны и Труда": [ 5, 1 ], 1416 "День народного единства": [ 11, 4 ], 1417 "День России": [ 6, 12 ], 1418 // local 1419 "День Республики Саха": [ 4, 27 ], 1420 "Ысыах": [ 6, 23 ], 1421 "День государственности Республики Саха": [ 9, 27 ], 1422 }, 1423 }, 1424 'Republic of Kalmykia': { // https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%B8_%D0%BF%D0%B0%D0%BC%D1%8F%D1%82%D0%BD%D1%8B%D0%B5_%D0%B4%D0%B0%D1%82%D1%8B_%D0%9A%D0%B0%D0%BB%D0%BC%D1%8B%D0%BA%D0%B8%D0%B8 1425 'PH': { 1426 "1. Новогодние каникулы": [ 1, 1 ], 1427 "2. Новогодние каникулы": [ 1, 2 ], 1428 "3. Новогодние каникулы": [ 1, 3 ], 1429 "4. Новогодние каникулы": [ 1, 4 ], 1430 "5. Новогодние каникулы": [ 1, 5 ], 1431 "6. Новогодние каникулы": [ 1, 6 ], 1432 "Рождество Христово": [ 1, 7 ], 1433 "8. Новогодние каникулы": [ 1, 8 ], 1434 "День защитника Отечества": [ 2, 23 ], 1435 "Международный женский день": [ 3, 8 ], 1436 "День Победы": [ 5, 9 ], 1437 "Праздник Весны и Труда": [ 5, 1 ], 1438 "День народного единства": [ 11, 4 ], 1439 "День России": [ 6, 12 ], 1440 // local 1441 "Цаган Сар": [ 1, 14 ], 1442 "День принятия Степного Уложения (Конституции) Республики Калмыкия": [ 4, 5 ], 1443 "День рождения Будды Шакьямун": [ 6, 6 ], 1444 "Зул": [ 12, 15 ], 1445 "День памяти жертв депортации калмыцкого народа": [ 12, 28 ], 1446 }, 1447 }, 1448 'Buryatia': { // https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%91%D1%83%D1%80%D1%8F%D1%82%D0%B8%D0%B8 1449 'PH': { 1450 "1. Новогодние каникулы": [ 1, 1 ], 1451 "2. Новогодние каникулы": [ 1, 2 ], 1452 "3. Новогодние каникулы": [ 1, 3 ], 1453 "4. Новогодние каникулы": [ 1, 4 ], 1454 "5. Новогодние каникулы": [ 1, 5 ], 1455 "6. Новогодние каникулы": [ 1, 6 ], 1456 "Рождество Христово": [ 1, 7 ], 1457 "8. Новогодние каникулы": [ 1, 8 ], 1458 "День защитника Отечества": [ 2, 23 ], 1459 "Международный женский день": [ 3, 8 ], 1460 "День Победы": [ 5, 9 ], 1461 "Праздник Весны и Труда": [ 5, 1 ], 1462 "День народного единства": [ 11, 4 ], 1463 "День России": [ 6, 12 ], 1464 // 1465 "Сагаалган": [ 1, 14 ], 1466 }, 1467 }, 1468 'Republic of Karelia': { // https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%A0%D0%B5%D1%81%D0%BF%D1%83%D0%B1%D0%BB%D0%B8%D0%BA%D0%B8_%D0%9A%D0%B0%D1%80%D0%B5%D0%BB%D0%B8%D1%8F 1469 'PH': { 1470 "1. Новогодние каникулы": [ 1, 1 ], 1471 "2. Новогодние каникулы": [ 1, 2 ], 1472 "3. Новогодние каникулы": [ 1, 3 ], 1473 "4. Новогодние каникулы": [ 1, 4 ], 1474 "5. Новогодние каникулы": [ 1, 5 ], 1475 "6. Новогодние каникулы": [ 1, 6 ], 1476 "Рождество Христово": [ 1, 7 ], 1477 "8. Новогодние каникулы": [ 1, 8 ], 1478 "День защитника Отечества": [ 2, 23 ], 1479 "Международный женский день": [ 3, 8 ], 1480 "День Победы": [ 5, 9 ], 1481 "Праздник Весны и Труда": [ 5, 1 ], 1482 "День народного единства": [ 11, 4 ], 1483 "День России": [ 6, 12 ], 1484 // local 1485 "День Республики Карелия": [ 6, 8 ], 1486 "День освобождения Карелии от фашистских захватчиков": [ 9, 30 ], 1487 }, 1488 }, 1489 'Удмуртская республика': { 1490 'PH': { 1491 "1. Новогодние каникулы": [ 1, 1 ], 1492 "2. Новогодние каникулы": [ 1, 2 ], 1493 "3. Новогодние каникулы": [ 1, 3 ], 1494 "4. Новогодние каникулы": [ 1, 4 ], 1495 "5. Новогодние каникулы": [ 1, 5 ], 1496 "6. Новогодние каникулы": [ 1, 6 ], 1497 "Рождество Христово": [ 1, 7 ], 1498 "8. Новогодние каникулы": [ 1, 8 ], 1499 "День защитника Отечества": [ 2, 23 ], 1500 "Международный женский день": [ 3, 8 ], 1501 "День Победы": [ 5, 9 ], 1502 "Праздник Весны и Труда": [ 5, 1 ], 1503 "День народного единства": [ 11, 4 ], 1504 "День России": [ 6, 12 ], 1505 // local 1506 "День Государственности Удмуртской Республики": [ 5, 31 ], 1507 }, 1508 }, 1509 'Adygea': { 1510 'PH': { 1511 "1. Новогодние каникулы": [ 1, 1 ], 1512 "2. Новогодние каникулы": [ 1, 2 ], 1513 "3. Новогодние каникулы": [ 1, 3 ], 1514 "4. Новогодние каникулы": [ 1, 4 ], 1515 "5. Новогодние каникулы": [ 1, 5 ], 1516 "6. Новогодние каникулы": [ 1, 6 ], 1517 "Рождество Христово": [ 1, 7 ], 1518 "8. Новогодние каникулы": [ 1, 8 ], 1519 "День защитника Отечества": [ 2, 23 ], 1520 "Международный женский день": [ 3, 8 ], 1521 "День Победы": [ 5, 9 ], 1522 "Праздник Весны и Труда": [ 5, 1 ], 1523 "День народного единства": [ 11, 4 ], 1524 "День России": [ 6, 12 ], 1525 // local 1526 "Ураза-байрам": [ 7, 28 ], 1527 "Курбан-байрам": [ 10, 4 ], 1528 "День образования Республики Адыгея": [ 10, 5 ], 1529 }, 1530 }, 1531 'Republic of Dagestan': { // https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%94%D0%B0%D0%B3%D0%B5%D1%81%D1%82%D0%B0%D0%BD%D0%B0 1532 'PH': { 1533 "1. Новогодние каникулы": [ 1, 1 ], 1534 "2. Новогодние каникулы": [ 1, 2 ], 1535 "3. Новогодние каникулы": [ 1, 3 ], 1536 "4. Новогодние каникулы": [ 1, 4 ], 1537 "5. Новогодние каникулы": [ 1, 5 ], 1538 "6. Новогодние каникулы": [ 1, 6 ], 1539 "Рождество Христово": [ 1, 7 ], 1540 "8. Новогодние каникулы": [ 1, 8 ], 1541 "День защитника Отечества": [ 2, 23 ], 1542 "Международный женский день": [ 3, 8 ], 1543 "День Победы": [ 5, 9 ], 1544 "Праздник Весны и Труда": [ 5, 1 ], 1545 "День народного единства": [ 11, 4 ], 1546 "День России": [ 6, 12 ], 1547 // local 1548 "День Конституции Республики Дагестан": [ 7, 26 ], 1549 "Ураза-байрам": [ 7, 28 ], 1550 "День единства народов Дагестана": [ 9, 15 ], 1551 "Курбан-байрам": [ 10, 4 ], 1552 }, 1553 }, 1554 'Ingushetia': { // https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%98%D0%BD%D0%B3%D1%83%D1%88%D0%B5%D1%82%D0%B8%D0%B8 1555 'PH': { 1556 "1. Новогодние каникулы": [ 1, 1 ], 1557 "2. Новогодние каникулы": [ 1, 2 ], 1558 "3. Новогодние каникулы": [ 1, 3 ], 1559 "4. Новогодние каникулы": [ 1, 4 ], 1560 "5. Новогодние каникулы": [ 1, 5 ], 1561 "6. Новогодние каникулы": [ 1, 6 ], 1562 "Рождество Христово": [ 1, 7 ], 1563 "8. Новогодние каникулы": [ 1, 8 ], 1564 "День защитника Отечества": [ 2, 23 ], 1565 "Международный женский день": [ 3, 8 ], 1566 "День Победы": [ 5, 9 ], 1567 "Праздник Весны и Труда": [ 5, 1 ], 1568 "День народного единства": [ 11, 4 ], 1569 "День России": [ 6, 12 ], 1570 // local 1571 "День образования Республики Ингушетия": [ 6, 4 ], 1572 "Ураза-байрам": [ 7, 28 ], 1573 "Курбан-байрам": [ 10, 4 ], 1574 }, 1575 }, 1576 'Карачаево-Черкесская республика': { 1577 'PH': { 1578 "1. Новогодние каникулы": [ 1, 1 ], 1579 "2. Новогодние каникулы": [ 1, 2 ], 1580 "3. Новогодние каникулы": [ 1, 3 ], 1581 "4. Новогодние каникулы": [ 1, 4 ], 1582 "5. Новогодние каникулы": [ 1, 5 ], 1583 "6. Новогодние каникулы": [ 1, 6 ], 1584 "Рождество Христово": [ 1, 7 ], 1585 "8. Новогодние каникулы": [ 1, 8 ], 1586 "День защитника Отечества": [ 2, 23 ], 1587 "Международный женский день": [ 3, 8 ], 1588 "День Победы": [ 5, 9 ], 1589 "Праздник Весны и Труда": [ 5, 1 ], 1590 "День народного единства": [ 11, 4 ], 1591 "День России": [ 6, 12 ], 1592 // local 1593 "День возрождения карачаевского народа": [ 5, 3 ], 1594 "Ураза-байрам": [ 7, 28 ], 1595 "Курбан-байрам": [ 10, 4 ], 1596 }, 1597 }, 1598 'Chechen Republic': { // https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%A7%D0%B5%D1%87%D0%BD%D0%B8 1599 'PH': { 1600 "1. Новогодние каникулы": [ 1, 1 ], 1601 "2. Новогодние каникулы": [ 1, 2 ], 1602 "3. Новогодние каникулы": [ 1, 3 ], 1603 "4. Новогодние каникулы": [ 1, 4 ], 1604 "5. Новогодние каникулы": [ 1, 5 ], 1605 "6. Новогодние каникулы": [ 1, 6 ], 1606 "Рождество Христово": [ 1, 7 ], 1607 "8. Новогодние каникулы": [ 1, 8 ], 1608 "День защитника Отечества": [ 2, 23 ], 1609 "Международный женский день": [ 3, 8 ], 1610 "День Победы": [ 5, 9 ], 1611 "Праздник Весны и Труда": [ 5, 1 ], 1612 "День народного единства": [ 11, 4 ], 1613 "День России": [ 6, 12 ], 1614 // local 1615 "День мира в Чеченской Республике": [ 4, 16 ], 1616 "Ураза-байрам": [ 7, 28 ], 1617 "Курбан-байрам": [ 10, 4 ], 1618 }, 1619 }, 1620 'Кабардино-Балкарская республика': { 1621 'PH': { 1622 "1. Новогодние каникулы": [ 1, 1 ], 1623 "2. Новогодние каникулы": [ 1, 2 ], 1624 "3. Новогодние каникулы": [ 1, 3 ], 1625 "4. Новогодние каникулы": [ 1, 4 ], 1626 "5. Новогодние каникулы": [ 1, 5 ], 1627 "6. Новогодние каникулы": [ 1, 6 ], 1628 "Рождество Христово": [ 1, 7 ], 1629 "8. Новогодние каникулы": [ 1, 8 ], 1630 "День защитника Отечества": [ 2, 23 ], 1631 "Международный женский день": [ 3, 8 ], 1632 "День Победы": [ 5, 9 ], 1633 "Праздник Весны и Труда": [ 5, 1 ], 1634 "День народного единства": [ 11, 4 ], 1635 "День России": [ 6, 12 ], 1636 // local 1637 "День возрождения балкарского народа": [ 3, 28 ], 1638 "Черкесский день траура": [ 5, 21 ], 1639 "Ураза-байрам": [ 7, 28 ], 1640 "День государственности Кабардино-Балкарской Республики": [ 9, 1 ], 1641 "Курбан-байрам": [ 10, 4 ], 1642 }, 1643 }, 1644 'Altai Republic': { 1645 'PH': { 1646 "1. Новогодние каникулы": [ 1, 1 ], 1647 "2. Новогодние каникулы": [ 1, 2 ], 1648 "3. Новогодние каникулы": [ 1, 3 ], 1649 "4. Новогодние каникулы": [ 1, 4 ], 1650 "5. Новогодние каникулы": [ 1, 5 ], 1651 "6. Новогодние каникулы": [ 1, 6 ], 1652 "Рождество Христово": [ 1, 7 ], 1653 "8. Новогодние каникулы": [ 1, 8 ], 1654 "День защитника Отечества": [ 2, 23 ], 1655 "Международный женский день": [ 3, 8 ], 1656 "День Победы": [ 5, 9 ], 1657 "Праздник Весны и Труда": [ 5, 1 ], 1658 "День народного единства": [ 11, 4 ], 1659 "День России": [ 6, 12 ], 1660 // local 1661 "Чага-Байрам": [ 1, 14 ], 1662 }, 1663 }, 1664 'Tuva': { 1665 'PH': { 1666 "1. Новогодние каникулы": [ 1, 1 ], 1667 "2. Новогодние каникулы": [ 1, 2 ], 1668 "3. Новогодние каникулы": [ 1, 3 ], 1669 "4. Новогодние каникулы": [ 1, 4 ], 1670 "5. Новогодние каникулы": [ 1, 5 ], 1671 "6. Новогодние каникулы": [ 1, 6 ], 1672 "Рождество Христово": [ 1, 7 ], 1673 "8. Новогодние каникулы": [ 1, 8 ], 1674 "День защитника Отечества": [ 2, 23 ], 1675 "Международный женский день": [ 3, 8 ], 1676 "День Победы": [ 5, 9 ], 1677 "Праздник Весны и Труда": [ 5, 1 ], 1678 "День народного единства": [ 11, 4 ], 1679 "День России": [ 6, 12 ], 1680 // local 1681 "Народный праздник Шагаа": [ 1, 14 ], 1682 "День Республики Тыва": [ 8, 15 ], 1683 }, 1684 }, 1685 'Saratov Oblast': { 1686 'PH': { 1687 "1. Новогодние каникулы": [ 1, 1 ], 1688 "2. Новогодние каникулы": [ 1, 2 ], 1689 "3. Новогодние каникулы": [ 1, 3 ], 1690 "4. Новогодние каникулы": [ 1, 4 ], 1691 "5. Новогодние каникулы": [ 1, 5 ], 1692 "6. Новогодние каникулы": [ 1, 6 ], 1693 "Рождество Христово": [ 1, 7 ], 1694 "8. Новогодние каникулы": [ 1, 8 ], 1695 "День защитника Отечества": [ 2, 23 ], 1696 "Международный женский день": [ 3, 8 ], 1697 "День Победы": [ 5, 9 ], 1698 "Праздник Весны и Труда": [ 5, 1 ], 1699 "День народного единства": [ 11, 4 ], 1700 "День России": [ 6, 12 ], 1701 // local 1702 "Радоница": [ 4, 29 ], 1703 }, 1704 }, 1705 'Bryansk Oblast': { 1706 'PH': { 1707 "1. Новогодние каникулы": [ 1, 1 ], 1708 "2. Новогодние каникулы": [ 1, 2 ], 1709 "3. Новогодние каникулы": [ 1, 3 ], 1710 "4. Новогодние каникулы": [ 1, 4 ], 1711 "5. Новогодние каникулы": [ 1, 5 ], 1712 "6. Новогодние каникулы": [ 1, 6 ], 1713 "Рождество Христово": [ 1, 7 ], 1714 "8. Новогодние каникулы": [ 1, 8 ], 1715 "День защитника Отечества": [ 2, 23 ], 1716 "Международный женский день": [ 3, 8 ], 1717 "День Победы": [ 5, 9 ], 1718 "Праздник Весны и Труда": [ 5, 1 ], 1719 "День народного единства": [ 11, 4 ], 1720 "День России": [ 6, 12 ], 1721 // local 1722 "Радоница": [ 4, 29 ], 1723 "День освобождения города Брянска": [ 9, 17 ], 1724 }, 1725 }, 1726 'Komi Republic': { 1727 'PH': { 1728 "1. Новогодние каникулы": [ 1, 1 ], 1729 "2. Новогодние каникулы": [ 1, 2 ], 1730 "3. Новогодние каникулы": [ 1, 3 ], 1731 "4. Новогодние каникулы": [ 1, 4 ], 1732 "5. Новогодние каникулы": [ 1, 5 ], 1733 "6. Новогодние каникулы": [ 1, 6 ], 1734 "Рождество Христово": [ 1, 7 ], 1735 "8. Новогодние каникулы": [ 1, 8 ], 1736 "День защитника Отечества": [ 2, 23 ], 1737 "Международный женский день": [ 3, 8 ], 1738 "День Победы": [ 5, 9 ], 1739 "Праздник Весны и Труда": [ 5, 1 ], 1740 "День народного единства": [ 11, 4 ], 1741 "День России": [ 6, 12 ], 1742 // local 1743 "День Республики Коми": [ 8, 22 ], 1744 }, 1745 }, 1746 }, // }}} 1311 1747 'ua': { // {{{ 1312 1748 'PH': { // http://uk.wikipedia.org/wiki/%D0%A1%D0%B2%D1%8F%D1%82%D0%B0_%D1%82%D0%B0_%D0%BF%D0%B0%D0%BC%27%D1%8F%D1%82%D0%BD%D1%96_%D0%B4%D0%BD%D1%96_%D0%B2_%D0%A3%D0%BA%D1%80%D0%B0%D1%97%D0%BD%D1%96 … … 1320 1756 "День Конституції України" : [ 6, 28 ], 1321 1757 "День Незалежності України" : [ 8, 24 ], 1758 } 1759 }, // }}} 1760 'us': { // {{{ 1761 'PH': { // https://en.wikipedia.org/wiki/Public_holidays_in_the_United_States 1762 "New Year's Day" : [ 1, 1 ], 1763 "Memorial Day" : [ "lastMayMonday", 0 ], 1764 "Independence Day" : [ 7, 4 ], 1765 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1766 "Veterans Day" : [ 11, 11 ], 1767 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1768 "Christmas Day" : [ 12, 25 ] 1769 }, 1770 'Alabama': { 1771 'PH': { // http://www.archives.alabama.gov/intro/holidays.html 1772 "New Year's Day" : [ 1, 1 ], 1773 "Robert E. Lee/Martin Luther King Birthday" : [ "firstJanuaryMonday", 14 ], 1774 "George Washington/Thomas Jefferson Birthday" : [ "firstFebruaryMonday", 14 ], 1775 "Memorial Day" : [ "lastMayMonday", 0 ], 1776 "Independence Day" : [ 7, 4 ], 1777 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1778 "Columbus Day" : [ "firstOctoberMonday", 7 ], 1779 "Veterans Day" : [ 11, 11 ], 1780 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1781 "Christmas Day" : [ 12, 25 ], 1782 "Confederate Memorial Day" : [ "firstAprilMonday", 21 ], 1783 "Jefferson Davis' Birthday" : [ "firstJuneMonday", 0 ] 1784 } 1785 }, 1786 'Alaska': { 1787 'PH': { 1788 "New Year's Day" : [ 1, 1 ], 1789 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 1790 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 1791 "Memorial Day" : [ "lastMayMonday", 0 ], 1792 "Independence Day" : [ 7, 4 ], 1793 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1794 "Veterans Day" : [ 11, 11 ], 1795 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1796 "Christmas Day" : [ 12, 25 ], 1797 "Seward's Day" : [ "lastMarchMonday", 0 ], 1798 "Alaska Day" : [ 10, 18 ] 1799 } 1800 }, 1801 'Arizona': { 1802 'PH': { 1803 "New Year's Day" : [ 1, 1 ], 1804 "Dr. Martin Luther King Jr./Civil Rights Day" : [ "firstJanuaryMonday", 14 ], 1805 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 1806 "Memorial Day" : [ "lastMayMonday", 0 ], 1807 "Independence Day" : [ 7, 4 ], 1808 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1809 "Columbus Day" : [ "firstOctoberMonday", 7 ], 1810 "Veterans Day" : [ 11, 11 ], 1811 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1812 "Christmas Day" : [ 12, 25 ] 1813 } 1814 }, 1815 'Arkansas': { 1816 'PH': { 1817 "New Year's Day" : [ 1, 1 ], 1818 "Dr. Martin Luther King Jr. and Robert E. Lee's Birthdays" : [ "firstJanuaryMonday", 14 ], 1819 "George Washington's Birthday and Daisy Gatson Bates Day" : [ "firstFebruaryMonday", 14 ], 1820 "Memorial Day" : [ "lastMayMonday", 0 ], 1821 "Independence Day" : [ 7, 4 ], 1822 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1823 "Columbus Day" : [ "firstOctoberMonday", 7 ], 1824 "Veterans Day" : [ 11, 11 ], 1825 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1826 "Christmas Eve" : [ 12, 24 ], 1827 "Christmas Day" : [ 12, 25 ] 1828 } 1829 }, 1830 'California': { 1831 'PH': { 1832 "New Year's Day" : [ 1, 1 ], 1833 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 1834 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 1835 "Memorial Day" : [ "lastMayMonday", 0 ], 1836 "Independence Day" : [ 7, 4 ], 1837 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1838 "Columbus Day" : [ "firstOctoberMonday", 7 ], 1839 "Veterans Day" : [ 11, 11 ], 1840 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1841 "Christmas Day" : [ 12, 25 ], 1842 "César Chávez Day" : [ 3, 31 ] 1843 } 1844 }, 1845 'Colorado': { 1846 'PH': { 1847 "New Year's Day" : [ 1, 1 ], 1848 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 1849 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 1850 "Memorial Day" : [ "lastMayMonday", 0 ], 1851 "Independence Day" : [ 7, 4 ], 1852 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1853 "Columbus Day" : [ "firstOctoberMonday", 7 ], 1854 "Veterans Day" : [ 11, 11 ], 1855 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1856 "Christmas Day" : [ 12, 25 ] 1857 } 1858 }, 1859 'Connecticut': { 1860 'PH': { 1861 "New Year's Day" : [ 1, 1 ], 1862 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 1863 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 1864 "Memorial Day" : [ "lastMayMonday", 0 ], 1865 "Independence Day" : [ 7, 4 ], 1866 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1867 "Columbus Day" : [ "firstOctoberMonday", 7 ], 1868 "Veterans Day" : [ 11, 11 ], 1869 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1870 "Christmas Day" : [ 12, 25 ], 1871 "Lincoln's Birthday" : [ 2, 12 ], 1872 "Good Friday" : [ "easter", -2 ] 1873 } 1874 }, 1875 'Delaware': { 1876 'PH': { 1877 "New Year's Day" : [ 1, 1 ], 1878 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 1879 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 1880 "Memorial Day" : [ "lastMayMonday", 0 ], 1881 "Independence Day" : [ 7, 4 ], 1882 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1883 "Columbus Day" : [ "firstOctoberMonday", 7 ], 1884 "Veterans Day" : [ 11, 11 ], 1885 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1886 "Day After Thanksgiving" : [ "firstNovemberThursday", 22 ], 1887 "Christmas Day" : [ 12, 25 ], 1888 "Good Friday" : [ "easter", -2 ] 1889 } 1890 }, 1891 'District of Columbia': { 1892 'PH': { 1893 "New Year's Day" : [ 1, 1 ], 1894 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 1895 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 1896 "Memorial Day" : [ "lastMayMonday", 0 ], 1897 "Independence Day" : [ 7, 4 ], 1898 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1899 "Columbus Day" : [ "firstOctoberMonday", 7 ], 1900 "Veterans Day" : [ 11, 11 ], 1901 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1902 "Christmas Day" : [ 12, 25 ], 1903 "Emancipation Day" : [ 4, 16 ] 1904 } 1905 }, 1906 'Florida': { 1907 'PH': { // http://www.leg.state.fl.us/Statutes/index.cfm?App_mode=Display_Statute&Search_String=&URL=0100-0199/0110/Sections/0110.117.html 1908 "New Year's Day" : [ 1, 1 ], 1909 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 1910 "Memorial Day" : [ "lastMayMonday", 0 ], 1911 "Independence Day" : [ 7, 4 ], 1912 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1913 "Veterans Day" : [ 11, 11 ], 1914 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1915 "Friday after Thanksgiving" : [ "firstNovemberThursday", 22 ], 1916 "Christmas Day" : [ 12, 25 ] 1917 } 1918 }, 1919 'Georgia': { 1920 'PH': { 1921 "New Year's Day" : [ 1, 1 ], 1922 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 1923 "Memorial Day" : [ "lastMayMonday", 0 ], 1924 "Independence Day" : [ 7, 4 ], 1925 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1926 "Columbus Day" : [ "firstOctoberMonday", 7 ], 1927 "Veterans Day" : [ 11, 11 ], 1928 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1929 "Robert E. Lee's Birthday" : [ "firstNovemberThursday", 22 ], 1930 "Washington's Birthday" : [ 12, 24 ], 1931 "Christmas Day" : [ 12, 25 ], 1932 "Confederate Memorial Day" : [ "lastAprilMonday", 0 ] 1933 } 1934 }, 1935 'Guam': { 1936 'PH': { 1937 "New Year's Day" : [ 1, 1 ], 1938 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 1939 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 1940 "Memorial Day" : [ "lastMayMonday", 0 ], 1941 "Independence Day" : [ 7, 4 ], 1942 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1943 "Columbus Day" : [ "firstOctoberMonday", 7 ], 1944 "Veterans Day" : [ 11, 11 ], 1945 "Guam Discovery Day" : [ 3, 5 ], 1946 "Good Friday" : [ "easter", -2 ], 1947 "Liberation Day" : [ 7, 21 ], 1948 "All Souls' Day" : [ 11, 2 ], 1949 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1950 "Lady of Camarin Day" : [ 12, 8 ], 1951 "Christmas Day" : [ 12, 25 ], 1952 } 1953 }, 1954 'Hawaii': { 1955 'PH': { 1956 "New Year's Day" : [ 1, 1 ], 1957 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 1958 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 1959 "Memorial Day" : [ "lastMayMonday", 0 ], 1960 "Independence Day" : [ 7, 4 ], 1961 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1962 "Veterans Day" : [ 11, 11 ], 1963 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1964 "Christmas Day" : [ 12, 25 ], 1965 "Prince Jonah Kuhio Kalanianaole Day" : [ 3, 26 ], 1966 "Kamehameha Day" : [ 6, 11 ], 1967 "Statehood Day" : [ "firstAugustFriday", 14 ], 1968 "Election Day" : [ "firstNovemberMonday", 1 ] 1969 } 1970 }, 1971 'Idaho': { 1972 'PH': { 1973 "New Year's Day" : [ 1, 1 ], 1974 "Martin Luther King, Jr.-Idaho Human Rights Day" : [ "firstJanuaryMonday", 14 ], 1975 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 1976 "Memorial Day" : [ "lastMayMonday", 0 ], 1977 "Independence Day" : [ 7, 4 ], 1978 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1979 "Columbus Day" : [ "firstOctoberMonday", 7 ], 1980 "Veterans Day" : [ 11, 11 ], 1981 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1982 "Christmas Day" : [ 12, 25 ] 1983 } 1984 }, 1985 'Illinois': { 1986 'PH': { 1987 "New Year's Day" : [ 1, 1 ], 1988 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 1989 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 1990 "Memorial Day" : [ "lastMayMonday", 0 ], 1991 "Independence Day" : [ 7, 4 ], 1992 "Labor Day" : [ "firstSeptemberMonday", 0 ], 1993 "Columbus Day" : [ "firstOctoberMonday", 7 ], 1994 "Veterans Day" : [ 11, 11 ], 1995 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 1996 "Christmas Day" : [ 12, 25 ], 1997 "Lincoln's Birthday" : [ 2, 12 ], 1998 "Casimir Pulaski Day" : [ "firstMarchMonday", 0 ], 1999 "Election Day" : [ "firstNovemberMonday", 1 ] 2000 } 2001 }, 2002 'Indiana': { 2003 'PH': { 2004 "New Year's Day" : [ 1, 1 ], 2005 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2006 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2007 "Memorial Day" : [ "lastMayMonday", 0 ], 2008 "Independence Day" : [ 7, 4 ], 2009 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2010 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2011 "Veterans Day" : [ 11, 11 ], 2012 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2013 "Lincoln's Birthday" : [ "firstNovemberThursday", 22 ], 2014 "Christmas Day" : [ 12, 25 ], 2015 "Good Friday" : [ "easter", -2 ], 2016 "Primary Election Day" : [ "firstMayMonday", 1 ], 2017 "Election Day" : [ "firstNovemberMonday", 1 ] 2018 } 2019 }, 2020 'Iowa': { 2021 'PH': { 2022 "New Year's Day" : [ 1, 1 ], 2023 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2024 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2025 "Memorial Day" : [ "lastMayMonday", 0 ], 2026 "Independence Day" : [ 7, 4 ], 2027 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2028 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2029 "Veterans Day" : [ 11, 11 ], 2030 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2031 "Christmas Day" : [ 12, 25 ], 2032 "Lincoln's Birthday" : [ 2, 12 ] 2033 } 2034 }, 2035 'Kansas': { 2036 'PH': { 2037 "New Year's Day" : [ 1, 1 ], 2038 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2039 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2040 "Memorial Day" : [ "lastMayMonday", 0 ], 2041 "Independence Day" : [ 7, 4 ], 2042 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2043 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2044 "Veterans Day" : [ 11, 11 ], 2045 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2046 "Christmas Day" : [ 12, 25 ] 2047 } 2048 }, 2049 'Kentucky': { 2050 'PH': { 2051 "New Year's Day" : [ 1, 1 ], 2052 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2053 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2054 "Memorial Day" : [ "lastMayMonday", 0 ], 2055 "Independence Day" : [ 7, 4 ], 2056 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2057 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2058 "Veterans Day" : [ 11, 11 ], 2059 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2060 "Christmas Eve" : [ 12, 24 ], 2061 "Christmas Day" : [ 12, 25 ], 2062 "New Year's Eve" : [ 12, 31 ], 2063 "Good Friday" : [ "easter", -2 ] 2064 } 2065 }, 2066 'Louisiana': { 2067 'PH': { 2068 "New Year's Day" : [ 1, 1 ], 2069 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2070 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2071 "Memorial Day" : [ "lastMayMonday", 0 ], 2072 "Independence Day" : [ 7, 4 ], 2073 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2074 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2075 "Veterans Day" : [ 11, 11 ], 2076 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2077 "Christmas Day" : [ 12, 25 ], 2078 "Mardi Gras" : [ "easter", -47 ], 2079 "Good Friday" : [ "easter", -2 ], 2080 "Election Day" : [ "firstNovemberMonday", 1 ] 2081 } 2082 }, 2083 'Maine': { 2084 'PH': { 2085 "New Year's Day" : [ 1, 1 ], 2086 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2087 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2088 "Memorial Day" : [ "lastMayMonday", 0 ], 2089 "Independence Day" : [ 7, 4 ], 2090 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2091 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2092 "Veterans Day" : [ 11, 11 ], 2093 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2094 "Christmas Day" : [ 12, 25 ], 2095 "Patriots' Day" : [ "firstAprilMonday", 14 ] 2096 } 2097 }, 2098 'Maryland': { 2099 'PH': { 2100 "New Year's Day" : [ 1, 1 ], 2101 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2102 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2103 "Memorial Day" : [ "lastMayMonday", 0 ], 2104 "Independence Day" : [ 7, 4 ], 2105 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2106 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2107 "Veterans Day" : [ 11, 11 ], 2108 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2109 "Native American Heritage Day" : [ "firstNovemberThursday", 22 ], 2110 "Christmas Day" : [ 12, 25 ] 2111 } 2112 }, 2113 'Massachusetts': { 2114 'PH': { 2115 "New Year's Day" : [ 1, 1 ], 2116 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2117 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2118 "Memorial Day" : [ "lastMayMonday", 0 ], 2119 "Independence Day" : [ 7, 4 ], 2120 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2121 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2122 "Veterans Day" : [ 11, 11 ], 2123 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2124 "Christmas Day" : [ 12, 25 ], 2125 "Patriots' Day" : [ "firstAprilMonday", 14 ] 2126 } 2127 }, 2128 'Michigan': { 2129 'PH': { 2130 "New Year's Day" : [ 1, 1 ], 2131 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2132 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2133 "Memorial Day" : [ "lastMayMonday", 0 ], 2134 "Independence Day" : [ 7, 4 ], 2135 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2136 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2137 "Veterans Day" : [ 11, 11 ], 2138 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2139 "Christmas Eve" : [ 12, 24 ], 2140 "Christmas Day" : [ 12, 25 ], 2141 "New Year's Eve" : [ 12, 31 ] 2142 } 2143 }, 2144 'Minnesota': { 2145 'PH': { 2146 "New Year's Day" : [ 1, 1 ], 2147 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2148 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2149 "Memorial Day" : [ "lastMayMonday", 0 ], 2150 "Independence Day" : [ 7, 4 ], 2151 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2152 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2153 "Veterans Day" : [ 11, 11 ], 2154 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2155 "Christmas Day" : [ 12, 25 ] 2156 } 2157 }, 2158 'Mississippi': { 2159 'PH': { 2160 "New Year's Day" : [ 1, 1 ], 2161 "Martin Luther King's and Robert E. Lee's Birthdays" : [ "firstJanuaryMonday", 14 ], 2162 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2163 "Memorial Day" : [ "lastMayMonday", 0 ], 2164 "Independence Day" : [ 7, 4 ], 2165 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2166 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2167 "Veterans Day" : [ 11, 11 ], 2168 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2169 "Christmas Day" : [ 12, 25 ], 2170 "Confederate Memorial Day" : [ "lastAprilMonday", 0 ] 2171 } 2172 }, 2173 'Missouri': { 2174 'PH': { 2175 "New Year's Day" : [ 1, 1 ], 2176 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2177 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2178 "Memorial Day" : [ "lastMayMonday", 0 ], 2179 "Independence Day" : [ 7, 4 ], 2180 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2181 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2182 "Veterans Day" : [ 11, 11 ], 2183 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2184 "Christmas Day" : [ 12, 25 ], 2185 "Truman Day" : [ 5, 8 ] 2186 } 2187 }, 2188 'Montana': { 2189 'PH': { 2190 "New Year's Day" : [ 1, 1 ], 2191 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2192 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2193 "Memorial Day" : [ "lastMayMonday", 0 ], 2194 "Independence Day" : [ 7, 4 ], 2195 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2196 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2197 "Veterans Day" : [ 11, 11 ], 2198 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2199 "Christmas Day" : [ 12, 25 ], 2200 "Election Day" : [ "firstNovemberMonday", 1 ], 2201 "Christmas Eve" : [ 12, 24 ], 2202 "New Year's Eve" : [ 12, 31 ] 2203 } 2204 }, 2205 'Nebraska': { 2206 'PH': { 2207 "New Year's Day" : [ 1, 1 ], 2208 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2209 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2210 "Memorial Day" : [ "lastMayMonday", 0 ], 2211 "Independence Day" : [ 7, 4 ], 2212 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2213 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2214 "Veterans Day" : [ 11, 11 ], 2215 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2216 "Christmas Day" : [ 12, 25 ], 2217 "Arbor Day" : [ "lastAprilFriday", 0 ] 2218 } 2219 }, 2220 'Nevada': { 2221 'PH': { 2222 "New Year's Day" : [ 1, 1 ], 2223 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2224 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2225 "Memorial Day" : [ "lastMayMonday", 0 ], 2226 "Independence Day" : [ 7, 4 ], 2227 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2228 "Veterans Day" : [ 11, 11 ], 2229 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2230 "Christmas Day" : [ 12, 25 ], 2231 "Nevada Day" : [ "lastOctoberFriday", 0 ], 2232 "Family Day" : [ "firstNovemberThursday", 22 ] 2233 } 2234 }, 2235 'New Hampshire': { 2236 'PH': { 2237 "New Year's Day" : [ 1, 1 ], 2238 "Martin Luther King, Jr. Civil Rights Day" : [ "firstJanuaryMonday", 14 ], 2239 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2240 "Memorial Day" : [ "lastMayMonday", 0 ], 2241 "Independence Day" : [ 7, 4 ], 2242 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2243 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2244 "Veterans Day" : [ 11, 11 ], 2245 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2246 "Day after Thanksgiving" : [ "firstNovemberThursday", 22 ], 2247 "Christmas Day" : [ 12, 25 ], 2248 "Election Day" : [ "firstNovemberMonday", 1 ] 2249 } 2250 }, 2251 'New Jersey': { 2252 'PH': { 2253 "New Year's Day" : [ 1, 1 ], 2254 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2255 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2256 "Memorial Day" : [ "lastMayMonday", 0 ], 2257 "Independence Day" : [ 7, 4 ], 2258 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2259 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2260 "Veterans Day" : [ 11, 11 ], 2261 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2262 "Christmas Day" : [ 12, 25 ], 2263 "Lincoln's Birthday" : [ 2, 12 ], 2264 "Good Friday" : [ "easter", -2 ], 2265 "Election Day" : [ "firstNovemberMonday", 1 ] 2266 } 2267 }, 2268 'New Mexico': { 2269 'PH': { 2270 "New Year's Day" : [ 1, 1 ], 2271 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2272 "Memorial Day" : [ "lastMayMonday", 0 ], 2273 "Independence Day" : [ 7, 4 ], 2274 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2275 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2276 "Veterans Day" : [ 11, 11 ], 2277 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2278 "Day after Thanksgiving" : [ "firstNovemberThursday", 22 ], 2279 "Christmas Day" : [ 12, 25 ] 2280 } 2281 }, 2282 'New York': { 2283 'PH': { 2284 "New Year's Day" : [ 1, 1 ], 2285 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2286 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2287 "Memorial Day" : [ "lastMayMonday", 0 ], 2288 "Independence Day" : [ 7, 4 ], 2289 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2290 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2291 "Veterans Day" : [ 11, 11 ], 2292 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2293 "Christmas Day" : [ 12, 25 ], 2294 "Lincoln's Birthday" : [ 2, 12 ], 2295 "Election Day" : [ "firstNovemberMonday", 1 ] 2296 } 2297 }, 2298 'North Carolina': { 2299 'PH': { 2300 "New Year's Day" : [ 1, 1 ], 2301 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2302 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2303 "Memorial Day" : [ "lastMayMonday", 0 ], 2304 "Independence Day" : [ 7, 4 ], 2305 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2306 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2307 "Veterans Day" : [ 11, 11 ], 2308 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2309 "Day after Thanksgiving" : [ "firstNovemberThursday", 22 ], 2310 "Christmas Eve" : [ 12, 24 ], 2311 "Christmas Day" : [ 12, 25 ], 2312 "Day after Christmas" : [ 12, 26 ], 2313 "Good Friday" : [ "easter", -2 ] 2314 } 2315 }, 2316 'North Dakota': { 2317 'PH': { 2318 "New Year's Day" : [ 1, 1 ], 2319 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2320 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2321 "Memorial Day" : [ "lastMayMonday", 0 ], 2322 "Independence Day" : [ 7, 4 ], 2323 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2324 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2325 "Veterans Day" : [ 11, 11 ], 2326 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2327 "Christmas Day" : [ 12, 25 ] 2328 } 2329 }, 2330 'Ohio': { 2331 'PH': { 2332 "New Year's Day" : [ 1, 1 ], 2333 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2334 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2335 "Memorial Day" : [ "lastMayMonday", 0 ], 2336 "Independence Day" : [ 7, 4 ], 2337 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2338 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2339 "Veterans Day" : [ 11, 11 ], 2340 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2341 "Christmas Day" : [ 12, 25 ] 2342 } 2343 }, 2344 'Oklahoma': { 2345 'PH': { 2346 "New Year's Day" : [ 1, 1 ], 2347 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2348 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2349 "Memorial Day" : [ "lastMayMonday", 0 ], 2350 "Independence Day" : [ 7, 4 ], 2351 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2352 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2353 "Veterans Day" : [ 11, 11 ], 2354 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2355 "Day after Thanksgiving" : [ "firstNovemberThursday", 22 ], 2356 "Christmas Day" : [ 12, 25 ] 2357 } 2358 }, 2359 'Oregon': { 2360 'PH': { 2361 "New Year's Day" : [ 1, 1 ], 2362 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2363 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2364 "Memorial Day" : [ "lastMayMonday", 0 ], 2365 "Independence Day" : [ 7, 4 ], 2366 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2367 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2368 "Veterans Day" : [ 11, 11 ], 2369 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2370 "Christmas Day" : [ 12, 25 ] 2371 } 2372 }, 2373 'Pennsylvania': { 2374 'PH': { 2375 "New Year's Day" : [ 1, 1 ], 2376 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2377 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2378 "Memorial Day" : [ "lastMayMonday", 0 ], 2379 "Independence Day" : [ 7, 4 ], 2380 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2381 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2382 "Veterans Day" : [ 11, 11 ], 2383 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2384 "Christmas Day" : [ 12, 25 ], 2385 "Flag Day" : [ 6, 14 ] 2386 } 2387 }, 2388 'Puerto Rico': { 2389 'PH': { 2390 "Día de Año Nuevo" : [ 1, 1 ], 2391 "Día de Reyes" : [ 1, 6 ], 2392 "Natalicio de Eugenio María de Hostos" : [ "firstJanuaryMonday", 7 ], 2393 "Natalicio de Martin Luther King, Jr." : [ "firstJanuaryMonday", 14 ], 2394 "Día de los Presidentes" : [ "firstFebruaryMonday", 14 ], 2395 "Día de la Abolición de Esclavitud" : [ 3, 22 ], 2396 "Viernes Santo" : [ "easter", -2 ], 2397 "Natalicio de José de Diego" : [ "firstAprilMonday", 14 ], 2398 "Recordación de los Muertos de la Guerra" : [ "lastMayMonday", 0 ], 2399 "Día de la Independencia" : [ 7, 4 ], 2400 "Constitución de Puerto Rico" : [ 7, 25 ], 2401 "Natalicio de Dr. José Celso Barbosa" : [ 7, 27 ], 2402 "Día del Trabajo" : [ "firstSeptemberMonday", 0 ], 2403 "Día de la Raza Descubrimiento de América" : [ "firstOctoberMonday", 7 ], 2404 "Día del Veterano" : [ 11, 11 ], 2405 "Día del Descubrimiento de Puerto Rico" : [ 11, 19 ], 2406 "Día de Acción de Gracias" : [ "firstNovemberThursday", 21 ], 2407 "Noche Buena" : [ 12, 24 ], 2408 "Día de Navidad" : [ 12, 25 ] 2409 } 2410 }, 2411 'Rhode Island': { 2412 'PH': { 2413 "New Year's Day" : [ 1, 1 ], 2414 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2415 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2416 "Memorial Day" : [ "lastMayMonday", 0 ], 2417 "Independence Day" : [ 7, 4 ], 2418 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2419 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2420 "Veterans Day" : [ 11, 11 ], 2421 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2422 "Christmas Day" : [ 12, 25 ], 2423 "Victory Day" : [ "firstAugustMonday", 7 ] 2424 } 2425 }, 2426 'South Carolina': { 2427 'PH': { 2428 "New Year's Day" : [ 1, 1 ], 2429 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2430 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2431 "Memorial Day" : [ "lastMayMonday", 0 ], 2432 "Independence Day" : [ 7, 4 ], 2433 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2434 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2435 "Veterans Day" : [ 11, 11 ], 2436 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2437 "Christmas Day" : [ 12, 25 ], 2438 "Confederate Memorial Day" : [ 5, 10 ] 2439 } 2440 }, 2441 'South Dakota': { 2442 'PH': { 2443 "New Year's Day" : [ 1, 1 ], 2444 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2445 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2446 "Memorial Day" : [ "lastMayMonday", 0 ], 2447 "Independence Day" : [ 7, 4 ], 2448 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2449 "Native American Day" : [ "firstOctoberMonday", 7 ], 2450 "Veterans Day" : [ 11, 11 ], 2451 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2452 "Christmas Day" : [ 12, 25 ] 2453 } 2454 }, 2455 'Tennessee': { 2456 'PH': { 2457 "New Year's Day" : [ 1, 1 ], 2458 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2459 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2460 "Memorial Day" : [ "lastMayMonday", 0 ], 2461 "Independence Day" : [ 7, 4 ], 2462 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2463 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2464 "Veterans Day" : [ 11, 11 ], 2465 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2466 "Christmas Eve" : [ 12, 24 ], 2467 "Christmas Day" : [ 12, 25 ], 2468 "Good Friday" : [ "easter", -2 ] 2469 } 2470 }, 2471 'Texas': { 2472 'PH': { 2473 "New Year's Day" : [ 1, 1 ], 2474 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2475 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2476 "Memorial Day" : [ "lastMayMonday", 0 ], 2477 "Independence Day" : [ 7, 4 ], 2478 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2479 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2480 "Veterans Day" : [ 11, 11 ], 2481 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2482 "Friday after Thanksgiving" : [ "firstNovemberThursday", 22 ], 2483 "Christmas Eve" : [ 12, 24 ], 2484 "Christmas Day" : [ 12, 25 ], 2485 "Day after Christmas" : [ 12, 26 ] 2486 } 2487 }, 2488 'United States Virgin Islands': { 2489 'PH': { 2490 "New Year's Day" : [ 1, 1 ], 2491 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2492 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2493 "Memorial Day" : [ "lastMayMonday", 0 ], 2494 "Independence Day" : [ 7, 4 ], 2495 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2496 "Virgin Islands-Puerto Rico Friendship Day" : [ "firstOctoberMonday", 7 ], 2497 "Veterans Day" : [ 11, 11 ], 2498 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2499 "Christmas Day" : [ 12, 25 ], 2500 "Three Kings Day" : [ 1, 6 ], 2501 "Transfer Day" : [ 3, 31 ], 2502 "Holy Thursday" : [ "easter", -3 ], 2503 "Good Friday" : [ "easter", -2 ], 2504 "Easter Monday" : [ "easter", 1 ], 2505 "Emancipation Day" : [ 7, 3 ], 2506 "Hurricane Supplication Day" : [ "firstJulyMonday", 21 ], 2507 "Hurricane Thanksgiving" : [ 10, 25 ], 2508 "Liberty Day" : [ 11, 1 ], 2509 "Christmas Second Day" : [ 12, 26 ], 2510 "New Year's Eve" : [ 12, 31 ] 2511 } 2512 }, 2513 'Utah': { 2514 'PH': { 2515 "New Year's Day" : [ 1, 1 ], 2516 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2517 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2518 "Memorial Day" : [ "lastMayMonday", 0 ], 2519 "Independence Day" : [ 7, 4 ], 2520 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2521 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2522 "Veterans Day" : [ 11, 11 ], 2523 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2524 "Christmas Day" : [ 12, 25 ], 2525 "Pioneer Day" : [ 7, 24 ] 2526 } 2527 }, 2528 'Vermont': { 2529 'PH': { 2530 "New Year's Day" : [ 1, 1 ], 2531 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2532 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2533 "Memorial Day" : [ "lastMayMonday", 0 ], 2534 "Independence Day" : [ 7, 4 ], 2535 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2536 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2537 "Veterans Day" : [ 11, 11 ], 2538 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2539 "Christmas Day" : [ 12, 25 ], 2540 "Town Meeting Day" : [ "firstMarchTuesday", 0 ], 2541 "Battle of Bennington" : [ "firstAugustMonday", 14 ] 2542 } 2543 }, 2544 'Virginia': { 2545 'PH': { 2546 "New Year's Day" : [ 1, 1 ], 2547 "Lee-Jackson Day" : [ "firstJanuaryMonday", 11 ], 2548 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2549 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2550 "Memorial Day" : [ "lastMayMonday", 0 ], 2551 "Independence Day" : [ 7, 4 ], 2552 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2553 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2554 "Veterans Day" : [ 11, 11 ], 2555 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2556 "Christmas Day" : [ 12, 25 ] 2557 } 2558 }, 2559 'Washington': { 2560 'PH': { 2561 "New Year's Day" : [ 1, 1 ], 2562 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2563 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2564 "Memorial Day" : [ "lastMayMonday", 0 ], 2565 "Independence Day" : [ 7, 4 ], 2566 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2567 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2568 "Veterans Day" : [ 11, 11 ], 2569 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2570 "Christmas Day" : [ 12, 25 ] 2571 } 2572 }, 2573 'West Virginia': { 2574 'PH': { 2575 "New Year's Day" : [ 1, 1 ], 2576 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2577 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2578 "Memorial Day" : [ "lastMayMonday", 0 ], 2579 "Independence Day" : [ 7, 4 ], 2580 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2581 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2582 "Veterans Day" : [ 11, 11 ], 2583 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2584 "Christmas Day" : [ 12, 25 ], 2585 "West Virginia Day" : [ 6, 20 ], 2586 "Lincoln's Day" : [ "firstNovemberThursday", 22 ] 2587 } 2588 }, 2589 'Wisconsin': { 2590 'PH': { // http://docs.legis.wisconsin.gov/statutes/statutes/995/20 2591 "New Year's Day" : [ 1, 1 ], 2592 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2593 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2594 "Memorial Day" : [ "lastMayMonday", 0 ], 2595 "Independence Day" : [ 7, 4 ], 2596 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2597 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2598 "Veterans Day" : [ 11, 11 ], 2599 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2600 "Christmas Day" : [ 12, 25 ], 2601 "Primary Election Day" : [ "firstAugustTuesday", 7 ], 2602 "Election Day" : [ "firstNovemberMonday", 1 ] 2603 } 2604 }, 2605 'Wyoming': { 2606 'PH': { 2607 "New Year's Day" : [ 1, 1 ], 2608 "Martin Luther King, Jr. Day" : [ "firstJanuaryMonday", 14 ], 2609 "Washington's Birthday" : [ "firstFebruaryMonday", 14 ], 2610 "Memorial Day" : [ "lastMayMonday", 0 ], 2611 "Independence Day" : [ 7, 4 ], 2612 "Labor Day" : [ "firstSeptemberMonday", 0 ], 2613 "Columbus Day" : [ "firstOctoberMonday", 7 ], 2614 "Veterans Day" : [ 11, 11 ], 2615 "Thanksgiving" : [ "firstNovemberThursday", 21 ], 2616 "Christmas Day" : [ 12, 25 ] 2617 } 1322 2618 } 1323 2619 }, // }}} … … 1337 2633 'dan spomina na mrtve' : [ 11, 1 ], 1338 2634 'božič' : [ 12, 25 ], 1339 'dan samostojnosti in enotnosti' : [ 12, 26 ], 2635 'dan samostojnosti in enotnosti' : [ 12, 26 ] 2636 } 2637 }, // }}} 2638 'it': { // {{{ 2639 'PH': { // http://www.governo.it/Presidenza/ufficio_cerimoniale/cerimoniale/giornate.html 2640 'Capodanno' : [ 1, 1 ], 2641 'Epifania' : [ 1, 6 ], 2642 'Liberazione dal nazifascismo (1945)' : [ 4, 25 ], 2643 'Pasqua' : [ 'easter', 0 ], 2644 'Lunedì di Pasqua' : [ 'easter', 1 ], 2645 'Festa del lavoro' : [ 5, 1 ], 2646 'Festa della Repubblica' : [ 6, 2 ], 2647 'Assunzione di Maria' : [ 8, 15 ], 2648 'Ognissanti' : [ 11, 1 ], 2649 'Festa dell’unità nazionale' : [ 'firstSeptemberSunday', 0 ], 2650 'Immacolata Concezione' : [ 12, 8 ], 2651 'Natale di Gesù' : [ 12, 25 ], 2652 'Santo Stefano' : [ 12, 26 ], 1340 2653 }, 1341 2654 }, // }}} … … 1405 2718 'til late': '+', 1406 2719 'till late': '+', 2720 'bis open end': '+', 1407 2721 '-late': '+', 1408 2722 '-open end': '+', … … 1497 2811 'geöffnet': '', 1498 2812 'zwischen': '', 2813 'ist': '', 2814 'durchgehend': '', 1499 2815 }, 'Bitte verzichte auf "<ko>". Sie möchten eventuell eine Öffnungszeit ohne vorgegebenes Ende (Open End) angeben. Beispiel: "12:00+"': { 1500 2816 'ab': '', … … 1507 2823 'täglich': 'Mo-Su', 1508 2824 'schulferien': 'SH', 2825 'sonn und feiertag': 'PH,Su', 2826 'sonn und feiertags': 'PH,Su', 2827 'sonn- und feiertags': 'PH,Su', 1509 2828 'sonn-/feiertag': 'PH,Su', 1510 2829 'sonn-/feiertags': 'PH,Su', 1511 2830 'an sonn- und feiertagen': 'PH,Su', 1512 2831 'nur sonn-/feiertags': 'PH,Su', 1513 }, 'Bitte benutze die Schreibweise "<ok>" für "<ko>". Es ist war typografisch korrekt aber laut der Spezifikation für opening_hours nicht erlaubt. Siehe auch: http://wiki.openstreetmap.org/wiki/DE:Key:opening_hours:specification.': { 2832 'sonn- und feiertage': 'PH,Su', 2833 }, 'Bitte benutze die Schreibweise "<ok>" für "<ko>". Es ist war typografisch korrekt aber laut der Spezifikation für opening_hours nicht erlaubt. Siehe auch: http://wiki.openstreetmap.org/wiki/DE:Key:opening_hours/specification.': { 1514 2834 '„': '"', 1515 2835 '“': '"', 1516 2836 '”': '"', 1517 }, 'Please use notation "<ok>" for "<ko>". The used quote signs might be typographically correct but are not defined in the specification. See http://wiki.openstreetmap.org/wiki/Key:opening_hours :specification.': {2837 }, 'Please use notation "<ok>" for "<ko>". The used quote signs might be typographically correct but are not defined in the specification. See http://wiki.openstreetmap.org/wiki/Key:opening_hours/specification.': { 1518 2838 '«': '"', 1519 2839 '»': '"', … … 1525 2845 '『': '"', 1526 2846 '』': '"', 1527 }, 'Please use notation "<ok>" for "<ko>". The used quote signs are not defined in the specification. See http://wiki.openstreetmap.org/wiki/Key:opening_hours :specification.': {2847 }, 'Please use notation "<ok>" for "<ko>". The used quote signs are not defined in the specification. See http://wiki.openstreetmap.org/wiki/Key:opening_hours/specification.': { 1528 2848 "'": '"', 1529 2849 }, 'You might want to use comments instead of brackets (which are not valid in this context). If you do, replace "<ok>" with "<ko>".': { … … 1663 2983 'son': 0, 1664 2984 'sonntag': 0, 1665 'sonn-': 0,2985 'sonn-': 0, 1666 2986 'sonntags': 0, 1667 2987 'montag': 1, … … 1675 2995 'mittwoch': 3, 1676 2996 'mittwochs': 3, 1677 'do': 4,2997 'do': 4, 1678 2998 'don': 4, 1679 2999 'donnerstag': 4, … … 1871 3191 // holidays. 1872 3192 var location_cc, location_state, lat, lon; 1873 if (typeof nominatiomJSON != 'undefined') { 1874 if (typeof nominatiomJSON.address != 'undefined' && 1875 typeof nominatiomJSON.address.state != 'undefined') { // country_code will be tested later … 1876 location_cc = nominatiomJSON.address.country_code; 1877 location_state = nominatiomJSON.address.state; 3193 if (typeof nominatiomJSON !== 'undefined') { 3194 if (typeof nominatiomJSON.address !== 'undefined') { 3195 if (typeof nominatiomJSON.address.country_code !== 'undefined') { 3196 location_cc = nominatiomJSON.address.country_code; 3197 } 3198 if (typeof nominatiomJSON.address.state !== 'undefined') { 3199 location_state = nominatiomJSON.address.state; 3200 } else if (typeof nominatiomJSON.address.county !== 'undefined') { 3201 location_state = nominatiomJSON.address.county; 3202 } 1878 3203 } 1879 3204 1880 if (typeof nominatiomJSON.lon != 'undefined') { // lat will be tested later …3205 if (typeof nominatiomJSON.lon !== 'undefined') { // lat will be tested later … 1881 3206 lat = nominatiomJSON.lat; 1882 3207 lon = nominatiomJSON.lon; … … 1887 3212 // 1: points in time 1888 3213 // 2: both (time ranges and points in time), tags: collection_times, service_times 1889 if (typeof oh_mode == 'undefined') {3214 if (typeof oh_mode === 'undefined') { 1890 3215 oh_mode = 0; 1891 } else if (!(typeof oh_mode == 'number' && (oh_mode === 0 || oh_mode == 1 || oh_mode== 2))) {3216 } else if (!(typeof oh_mode === 'number' && (oh_mode === 0 || oh_mode === 1 || oh_mode === 2))) { 1892 3217 throw 'The third constructor parameter is oh_mode and must be a number (0, 1 or 2)'; 1893 3218 } … … 1915 3240 parsing_warnings.push([nrule, -1, 1916 3241 'This rule does not contain anything useful. Please remove this empty rule.' 1917 + (nrule == tokens.length - 1 && nrule > 0 && !tokens[nrule][1] ?3242 + (nrule === tokens.length - 1 && nrule > 0 && !tokens[nrule][1] ? 1918 3243 ' Might it be possible that you are a programmer and adding a semicolon after each statement is hardwired in your muscle memory ;) ?' 1919 3244 + ' The thing is that the semicolon in the opening_hours syntax is defined as rule separator.' … … 1926 3251 var next_rule_is_additional = false; 1927 3252 do { 1928 if (continue_at == tokens[nrule][0].length) break;3253 if (continue_at === tokens[nrule][0].length) break; 1929 3254 // Additional rule does contain nothing useful e.g. second rule of '10:00-12:00,' (empty) which needs to be handled. 1930 3255 … … 1957 3282 selectors.build_from_token_rule = [ nrule, continue_at, new_tokens.length ]; 1958 3283 continue_at = parseGroup(tokens[nrule][0], continue_at, selectors, nrule); 1959 if (typeof continue_at == 'object') {3284 if (typeof continue_at === 'object') { 1960 3285 continue_at = continue_at[0]; 1961 3286 } else { … … 2013 3338 2014 3339 wrapped: true, 2015 // build_from_token_rule: selectors.build_from_token_rule, 2016 // Not (yet) needed. 3340 build_from_token_rule: selectors.build_from_token_rule, 2017 3341 }; 2018 3342 … … 2043 3367 function formatWarnErrorMessage(nrule, at, message) { 2044 3368 // FIXME: Change to new_tokens. 2045 if (typeof nrule == 'number') {3369 if (typeof nrule === 'number') { 2046 3370 var pos = 0; 2047 if (nrule == -1) { // Usage of rule index not required because we do have access to value.length.3371 if (nrule === -1) { // Usage of rule index not required because we do have access to value.length. 2048 3372 pos = value.length - at; 2049 3373 } else { // Issue accrued at a later time, position in string needs to be reconstructed. 2050 if (typeof tokens[nrule][0][at] == 'undefined') {2051 if (typeof tokens[nrule][0] && at == -1) {3374 if (typeof tokens[nrule][0][at] === 'undefined') { 3375 if (typeof tokens[nrule][0] && at === -1) { 2052 3376 pos = value.length; 2053 if (typeof tokens[nrule+1] == 'object' && typeof tokens[nrule+1][2]== 'number') {3377 if (typeof tokens[nrule+1] === 'object' && typeof tokens[nrule+1][2] === 'number') { 2054 3378 pos -= tokens[nrule+1][2]; 2055 } else if (typeof tokens[nrule][2] == 'number') {3379 } else if (typeof tokens[nrule][2] === 'number') { 2056 3380 pos -= tokens[nrule][2]; 2057 3381 } … … 2061 3385 formatLibraryBugMessage('Bug in warning generation code which could not determine the exact position of the warning or error in value.'); 2062 3386 pos = value.length; 2063 if (typeof tokens[nrule][2] != 'undefined') {3387 if (typeof tokens[nrule][2] !== 'undefined') { 2064 3388 // Fallback: Point to last token in the rule which caused the problem. 2065 3389 // Run real_test regularly to fix the problem before a user is confronted with it. … … 2074 3398 } else { 2075 3399 pos = value.length; 2076 if (typeof tokens[nrule][0][at+1] != 'undefined') {3400 if (typeof tokens[nrule][0][at+1] !== 'undefined') { 2077 3401 pos -= tokens[nrule][0][at+1][2]; 2078 } else if (typeof tokens[nrule][2] != 'undefined') {3402 } else if (typeof tokens[nrule][2] !== 'undefined') { 2079 3403 pos -= tokens[nrule][2]; 2080 3404 } … … 2082 3406 } 2083 3407 return value.substring(0, pos) + ' <--- (' + message + ')'; 2084 } else if (typeof nrule == 'string') {3408 } else if (typeof nrule === 'string') { 2085 3409 return nrule.substring(0, at) + ' <--- (' + message + ')'; 2086 3410 } … … 2094 3418 */ 2095 3419 function formatLibraryBugMessage(message) { 2096 if (typeof message == 'undefined')3420 if (typeof message === 'undefined') 2097 3421 message = ''; 2098 3422 else … … 2138 3462 curr_rule_tokens.push([tmp[0].toUpperCase(), 'holiday', value.length ]); 2139 3463 value = value.substr(2); 2140 } else if (tmp = value.match(/^(&|_|→|–|−|=|·|opening_hours=|ー|\?|~|~|:|°°|24x7|24 hours 7 days a week|24 hours|7 ?days(?:(?: a |\/)week)?|7j?\/7|all days?|every day| -?(?:(?:till? )?late|open[ ]?end)|(?:(?:one )?day (?:before|after) )?(?:school|public) holidays?|days?\b|до|рм|ам|jours fériés|on work days?|(?:nur |an )?sonn-(?:(?: und |\/)feiertag(?:s|en))?|[a-zäößàáéøčěíúýřПнВсо]+\b|à|á|mo|tu|we|th|fr|sa|su|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\.?/i)) {3464 } else if (tmp = value.match(/^(&|_|→|–|−|=|·|opening_hours=|ー|\?|~|~|:|°°|24x7|24 hours 7 days a week|24 hours|7 ?days(?:(?: a |\/)week)?|7j?\/7|all days?|every day|(?:|-|till? |bis )?(?:late|open[ ]?end)|(?:(?:one )?day (?:before|after) )?(?:school|public) holidays?|days?\b|до|рм|ам|jours fériés|on work days?|sonntag?|(?:nur |an )?sonn-?(?:(?: und |\/)feiertag(?:s|en?)?)?|[a-zäößàáéøčěíúýřПнВсо]+\b|à|á|mo|tu|we|th|fr|sa|su|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\.?/i)) { 2141 3465 /* Handle all remaining words and specific other characters with error tolerance. 2142 3466 * … … 2150 3474 var correct_val = returnCorrectWordOrToken(tmp[1].toLowerCase(), value.length); 2151 3475 // console.log('Error tolerance for string "' + tmp[1] + '" returned "' + correct_val + '".'); 2152 if (typeof correct_val == 'object') {3476 if (typeof correct_val === 'object') { 2153 3477 curr_rule_tokens.push([ correct_val[0], correct_val[1], value.length ]); 2154 3478 value = value.substr(tmp[0].length); 2155 } else if (typeof correct_val == 'string') {2156 if (tmp[1].toLowerCase() == 'pm') {3479 } else if (typeof correct_val === 'string') { 3480 if (tmp[1].toLowerCase() === 'pm') { 2157 3481 var hours_token_at = curr_rule_tokens.length - 1; 2158 3482 var hours_token; … … 2170 3494 } 2171 3495 2172 if (typeof hours_token == 'object' && hours_token[0] <= 12) {3496 if (typeof hours_token === 'object' && hours_token[0] <= 12) { 2173 3497 hours_token[0] += 12; 2174 3498 curr_rule_tokens[hours_token_at] = hours_token; … … 2196 3520 // number 2197 3521 if (Number(tmp[0]) > 1900) { // Assumed to be a year number. 2198 curr_rule_tokens.push([ tmp[0], 'year', value.length ]);3522 curr_rule_tokens.push([Number(tmp[0]), 'year', value.length ]); 2199 3523 if (Number(tmp[0]) >= 2100) // Probably an error 2200 3524 parsing_warnings.push([ -1, value.length - 1, … … 2223 3547 // console.log('Pos: ' + pos + ', substring: ' + tmp[pos]); 2224 3548 var correct_val = returnCorrectWordOrToken(tmp[pos], 2225 value.length - (pos == 3 ? tmp[1].length + tmp[2].length : 0)3549 value.length - (pos === 3 ? tmp[1].length + tmp[2].length : 0) 2226 3550 ); 2227 if (typeof correct_val != 'string' && tmp[pos] != '"') {3551 if (typeof correct_val !== 'string' && tmp[pos] !== '"') { 2228 3552 throw formatLibraryBugMessage( 2229 3553 'A character for error tolerance was allowed in the regular expression' … … 2265 3589 } else if (value.match(/^[:.]/)) { 2266 3590 // time separator 2267 if (value[0] == '.' && !done_with_warnings)3591 if (value[0] === '.' && !done_with_warnings) 2268 3592 parsing_warnings.push([ -1, value.length - 1, 'Please use ":" as hour/minute-separator' ]); 2269 3593 curr_rule_tokens.push([ ':', 'timesep', value.length ]); … … 2296 3620 for (var comment in word_error_correction[token_name]) { 2297 3621 for (var old_val in word_error_correction[token_name][comment]) { 2298 if (old_val == word) {3622 if (old_val === word) { 2299 3623 var val = word_error_correction[token_name][comment][old_val]; 2300 if (comment == 'default') {3624 if (comment === 'default') { 2301 3625 // Return internal representation of word. 2302 3626 return [ val, token_name ]; 2303 } else if (token_name == 'wrong_words' && !done_with_warnings) {3627 } else if (token_name === 'wrong_words' && !done_with_warnings) { 2304 3628 // Replace wrong words or characters with correct ones. 2305 3629 // This will return a string which is then being tokenized. … … 2311 3635 var correct_abbr; 2312 3636 for (correct_abbr in word_error_correction[token_name]['default']) { 2313 if (word_error_correction[token_name]['default'][correct_abbr] == val)3637 if (word_error_correction[token_name]['default'][correct_abbr] === val) 2314 3638 break; 2315 3639 } 2316 if (typeof correct_abbr == 'undefined') {3640 if (typeof correct_abbr === 'undefined') { 2317 3641 throw formatLibraryBugMessage('Including the stacktrace.'); 2318 3642 } 2319 if (token_name != 'timevar') {3643 if (token_name !== 'timevar') { 2320 3644 // Everything else than timevar: 2321 3645 // E.g. 'Mo' start with a upper case letter. … … 2343 3667 */ 2344 3668 function getWarnings(it) { 2345 if (!done_with_warnings && typeof it == 'object') {3669 if (!done_with_warnings && typeof it === 'object') { 2346 3670 /* getWarnings was called in a state without critical errors. 2347 3671 * We can do extended tests. … … 2378 3702 // console.log(selector_start_end_type, new_tokens[nrule][0].length); 2379 3703 2380 if (selector_start_end_type[0] == selector_start_end_type[1] &&2381 new_tokens[nrule][0][selector_start_end_type[0]][0] == '24/7'3704 if (selector_start_end_type[0] === selector_start_end_type[1] && 3705 new_tokens[nrule][0][selector_start_end_type[0]][0] === '24/7' 2382 3706 ) { 2383 3707 has_token['24/7'] = true; 2384 3708 } 2385 3709 2386 if (typeof used_selectors[nrule][selector_start_end_type[2]] != 'object') {3710 if (typeof used_selectors[nrule][selector_start_end_type[2]] !== 'object') { 2387 3711 used_selectors[nrule][selector_start_end_type[2]] = [ selector_start_end_type[1] ]; 2388 3712 } else { … … 2407 3731 + (selector_type.match(/^(?:comment|state)/) ? 2408 3732 ' ' + selector_type 2409 + (selector_type == 'state' ? ' keywords' : 's')3733 + (selector_type === 'state' ? ' keywords' : 's') 2410 3734 + ' in one rule.' 2411 3735 + ' You may only use one in one rule.' … … 2415 3739 + ' in one rule.' 2416 3740 + ' This is probably an error.' 2417 + ' Equal selector types can (and should) always be written in conjunction separated by comma or something.'3741 + ' Equal selector types can (and should) always be written in conjunction separated by comma.' 2418 3742 + ' Example for time ranges "12:00-13:00,15:00-18:00".' 2419 3743 + ' Example for weekdays "Mo-We,Fr".' … … 2486 3810 // "This rule will be evaluated as closed but it was specified as additional rule." 2487 3811 // + " It is enough to specify this rule as normal rule using the \";\" character." 2488 // + " See https://wiki.openstreetmap.org/wiki/Key:opening_hours :specification#explain:rule_modifier:closed."3812 // + " See https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#explain:rule_modifier:closed." 2489 3813 // ]); 2490 3814 } … … 2495 3819 var selector_type = used_selectors_types_array[nrule][i]; 2496 3820 var next_selector_type = used_selectors_types_array[nrule][i+1]; 2497 if ( ( wide_range_selectors.indexOf(selector_type) != -12498 && wide_range_selectors.indexOf(next_selector_type) != -12499 ) || ( small_range_selectors.indexOf(selector_type) != -12500 && small_range_selectors.indexOf(next_selector_type) != -1)3821 if ( ( wide_range_selectors.indexOf(selector_type) !== -1 3822 && wide_range_selectors.indexOf(next_selector_type) !== -1 3823 ) || ( small_range_selectors.indexOf(selector_type) !== -1 3824 && small_range_selectors.indexOf(next_selector_type) !== -1) 2501 3825 ) { 2502 3826 2503 if (new_tokens[nrule][0][used_selectors[nrule][selector_type][0]][0] == ':') {3827 if (new_tokens[nrule][0][used_selectors[nrule][selector_type][0]][0] === ':') { 2504 3828 parsing_warnings.push([nrule, used_selectors[nrule][selector_type][0], 2505 3829 "You have used the optional symbol <separator_for_readability> in the wrong place." … … 2549 3873 */ 2550 3874 function tokenIsTheBeginOfSelector(tokens, at) { 2551 if (typeof tokens[at][3] == 'string') {3875 if (typeof tokens[at][3] === 'string') { 2552 3876 return 3; 2553 } else if (tokens[at][1] == 'comment'2554 || tokens[at][1] == 'state'2555 || tokens[at][1] == '24/7'2556 || tokens[at][1] == 'rule separator'3877 } else if (tokens[at][1] === 'comment' 3878 || tokens[at][1] === 'state' 3879 || tokens[at][1] === '24/7' 3880 || tokens[at][1] === 'rule separator' 2557 3881 ){ 2558 3882 … … 2592 3916 2593 3917 // Include tailing colon. 2594 if (selector_end + 1 < tokens.length && tokens[selector_end + 1][0] == ':')3918 if (selector_end + 1 < tokens.length && tokens[selector_end + 1][0] === ':') 2595 3919 selector_end++; 2596 3920 … … 2622 3946 get_internals = false, 2623 3947 rule_index; 2624 if (typeof argument_hash != 'undefined') {3948 if (typeof argument_hash !== 'undefined') { 2625 3949 2626 3950 if (typeof argument_hash.conf === 'object') … … 2635 3959 2636 3960 for (var key in default_prettify_conf) { 2637 if (typeof user_conf[key] == 'undefined')3961 if (typeof user_conf[key] === 'undefined') 2638 3962 user_conf[key] = default_prettify_conf[key]; 2639 3963 } … … 2646 3970 // Rule does contain nothing useful e.g. second rule of '10:00-12:00;' (empty) which needs to be handled. 2647 3971 2648 if (typeof rule_index == 'number') {2649 if (rule_index != nrule) continue;3972 if (typeof rule_index === 'number') { 3973 if (rule_index !== nrule) continue; 2650 3974 } else { 2651 3975 if (nrule !== 0) … … 2654 3978 ? user_conf.rule_sep_string + '|| ' 2655 3979 : ( 2656 new_tokens[nrule][0][0][1] == 'rule separator'3980 new_tokens[nrule][0][0][1] === 'rule separator' 2657 3981 ? ',' 2658 3982 : ( … … 2679 4003 } 2680 4004 2681 if (selector_start_end_type[2] != 'rule separator') {4005 if (selector_start_end_type[2] !== 'rule separator') { 2682 4006 prettified_group_value.push( 2683 4007 [ … … 2721 4045 if (!done_with_selector_reordering_warnings) { 2722 4046 for (var i = 0, l = not_sorted_prettified_group_value.length; i < l; i++) { 2723 if (not_sorted_prettified_group_value[i] != prettified_group_value[i]) {4047 if (not_sorted_prettified_group_value[i] !== prettified_group_value[i]) { 2724 4048 // console.log(i + ': ' + prettified_group_value[i][0][2]); 2725 4049 var length = i + old_prettified_value_length; // i: Number of spaces in string. … … 2832 4156 at = parseWeekRange(tokens, at); 2833 4157 2834 } else if (at !== 0 && at != tokens.length - 1 && tokens[at][0]== ':') {4158 } else if (at !== 0 && at !== tokens.length - 1 && tokens[at][0] === ':') { 2835 4159 /* Ignore colon if they appear somewhere else than as time separator. 2836 4160 * Except the start or end of the value. 2837 4161 * This provides compatibility with the syntax proposed by Netzwolf: 2838 * http://wiki.openstreetmap.org/wiki/Key:opening_hours :specification#separator_for_readability4162 * http://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#separator_for_readability 2839 4163 * Check for valid use of <separator_for_readability> is implemented in function getWarnings(). 2840 4164 */ … … 2853 4177 } else if (matchTokens(tokens, at, 'state')) { 2854 4178 2855 if (tokens[at][0] == 'open') {4179 if (tokens[at][0] === 'open') { 2856 4180 selectors.meaning = true; 2857 } else if (tokens[at][0] == 'closed' || tokens[at][0]== 'off') {4181 } else if (tokens[at][0] === 'closed' || tokens[at][0] === 'off') { 2858 4182 selectors.meaning = false; 2859 4183 } else { … … 2864 4188 rule_modifier_specified = true; 2865 4189 at++; 2866 if (typeof tokens[at] == 'object' && tokens[at][0]== ',') // additional rule4190 if (typeof tokens[at] === 'object' && tokens[at][0] === ',') // additional rule 2867 4191 at = [ at + 1 ]; 2868 4192 … … 2878 4202 rule_modifier_specified = true; 2879 4203 at++; 2880 if (typeof tokens[at] == 'object' && tokens[at][0]== ',') // additional rule4204 if (typeof tokens[at] === 'object' && tokens[at][0] === ',') // additional rule 2881 4205 at = [ at + 1 ]; 2882 } else if ((at === 0 || at == tokens.length - 1) && matchTokens(tokens, at, 'rule separator')) {4206 } else if ((at === 0 || at === tokens.length - 1) && matchTokens(tokens, at, 'rule separator')) { 2883 4207 at++; 2884 4208 console.log("value: " + nrule); … … 2888 4212 throw formatWarnErrorMessage(nrule, at, 'Unexpected token: "' + tokens[at][1] 2889 4213 + '" This means that the syntax is not valid at that point or it is currently not supported.') 2890 + (warnings ? ' ' + warnings.join('; ') : '');2891 } 2892 2893 if (typeof at == 'object') { // additional rule4214 + (warnings ? (' ' + warnings.join('; ')) : ''); 4215 } 4216 4217 if (typeof at === 'object') { // additional rule 2894 4218 tokens[at[0] - 1][1] = 'rule separator'; 2895 4219 break; … … 2902 4226 function get_last_token_pos_in_token_group(tokens, at, last_at) { 2903 4227 for (at++; at < last_at; at++) { 2904 if (typeof tokens[at] != 'undefined') {2905 if (typeof tokens[at][3] == 'string'2906 || tokens[at][1] == 'comment'2907 || tokens[at][1] == 'state'){4228 if (typeof tokens[at] !== 'undefined') { 4229 if (typeof tokens[at][3] === 'string' 4230 || tokens[at][1] === 'comment' 4231 || tokens[at][1] === 'state'){ 2908 4232 2909 4233 return at - 1; … … 3020 4344 'Number between -5 and 5 (except 0) expected'); 3021 4345 3022 if (from == to) {4346 if (from === to) { 3023 4347 if (number !== 0) 3024 4348 throw formatWarnErrorMessage(nrule, at, … … 3047 4371 'You can not use '+ period_type +' ranges with period equals zero.'); 3048 4372 } else if (period === 1) { 3049 if (typeof parm_string == 'string' && parm_string== 'no_end_year')4373 if (typeof parm_string === 'string' && parm_string === 'no_end_year') 3050 4374 parsing_warnings.push([nrule, at, 3051 4375 'Please don’t use '+ period_type +' ranges with period equals one.' … … 3072 4396 tmp_date.setDate(tmp_date.getDate() + (constrained_weekday[0] + (constrained_weekday[0] > 0 ? -1 : 0)) * 7); 3073 4397 3074 if (typeof add_days != 'undefined' && add_days[1])4398 if (typeof add_days !== 'undefined' && add_days[1]) 3075 4399 tmp_date.setDate(tmp_date.getDate() + add_days[0]); 3076 4400 … … 3088 4412 // May use this instead. The problem is that this does not give feedback as precise as the code which is used in this function. 3089 4413 // var testDate = new Date(year, month, day); 3090 // if (testDate.getDate() != day || testDate.getMonth() != month || testDate.getFullYear() != year) {4414 // if (testDate.getDate() !== day || testDate.getMonth() !== month || testDate.getFullYear() !== year) { 3091 4415 // console.error('date not valid'); 3092 4416 // } … … 3095 4419 if (day < 1 || day > 31) 3096 4420 throw formatWarnErrorMessage(nrule, at, 'Day must be between 1 and 31.'); 3097 if ((month== 3 || month==5 || month==8 || month==10) && day==31)4421 if ((month===3 || month===5 || month===8 || month===10) && day===31) 3098 4422 throw formatWarnErrorMessage(nrule, at, 'Month ' + months[month] + " doesn't have 31 days.!"); 3099 if (month == 1 && day== 30)4423 if (month === 1 && day === 30) 3100 4424 throw formatWarnErrorMessage(nrule, at, 'Month ' + months[1]+ " either has 28 or 29 days (leap years)."); 3101 4425 } … … 3119 4443 for (; at < tokens.length; at++) { 3120 4444 var has_time_var_calc = [], has_normal_time = []; // element 0: start time, 1: end time 3121 has_normal_time[0] = matchTokens(tokens, at, 'number', 'timesep', 'number');4445 has_normal_time[0] = matchTokens(tokens, at, 'number', 'timesep', 'number'); 3122 4446 has_time_var_calc[0] = matchTokens(tokens, at, '(', 'timevar'); 3123 4447 var minutes_from, … … 3154 4478 at+( 3155 4479 has_normal_time[0] ? ( 3156 typeof tokens[at+3] == 'object' ? 3 : 24480 typeof tokens[at+3] === 'object' ? 3 : 2 3157 4481 ) : ( 3158 4482 has_time_var_calc[0] ? 2 : ( 3159 typeof tokens[at+1] != 'undefined' ? 1 : 04483 typeof tokens[at+1] !== 'undefined' ? 1 : 0 3160 4484 ) 3161 4485 ) … … 3186 4510 has_time_var_calc[1] = matchTokens(tokens, at_end_time, '(', 'timevar'); 3187 4511 if (!has_normal_time[1] && !matchTokens(tokens, at_end_time, 'timevar') && !has_time_var_calc[1]) { 3188 throw formatWarnErrorMessage(nrule, at_end_time - (typeof tokens[at_end_time] != 'undefined' ? 0 : 1),4512 throw formatWarnErrorMessage(nrule, at_end_time - (typeof tokens[at_end_time] !== 'undefined' ? 0 : 1), 3189 4513 'Time range does not continue as expected'); 3190 4514 } else { … … 3228 4552 parseTimeRange(tokens, at_end_time, selectors, minutes_to < minutes_from ? 1 : true); 3229 4553 at++; 3230 } else if (oh_mode == 1 && !is_point_in_time) {4554 } else if (oh_mode === 1 && !is_point_in_time) { 3231 4555 throw formatWarnErrorMessage(nrule, at_end_time, 3232 4556 'opening_hours is running in "points in time mode". Found time range.'); 3233 4557 } 3234 4558 3235 if (typeof lat != 'undefined') { // lon will also be defined (see above)4559 if (typeof lat !== 'undefined') { // lon will also be defined (see above) 3236 4560 if (!has_normal_time[0] || !(has_normal_time[1] || has_open_end || is_point_in_time) ) 3237 4561 week_stable = false; … … 3244 4568 throw formatWarnErrorMessage(nrule, at_end_time - 2, 3245 4569 'Time range starts outside of the current day'); 3246 if (minutes_to < minutes_from || ((has_normal_time[0] && has_normal_time[1]) && minutes_from == minutes_to))4570 if (minutes_to < minutes_from || ((has_normal_time[0] && has_normal_time[1]) && minutes_from === minutes_to)) 3247 4571 minutes_to += minutes_in_day; 3248 4572 if (minutes_to > minutes_in_day * 2) … … 3251 4575 3252 4576 // This shortcut makes always-open range check faster. 3253 if (minutes_from === 0 && minutes_to == minutes_in_day) {4577 if (minutes_from === 0 && minutes_to === minutes_in_day) { 3254 4578 selectors.time.push(function(date) { return [true]; }); 3255 4579 } else { … … 3269 4593 // normal times: if (minutes_to < minutes_from) 3270 4594 // above the selector construction. 3271 } else if (is_point_in_time && typeof point_in_time_period != 'number') {4595 } else if (is_point_in_time && typeof point_in_time_period !== 'number') { 3272 4596 minutes_to = minutes_from + 1; 3273 4597 } 3274 4598 3275 if (typeof point_in_time_period == 'number') {4599 if (typeof point_in_time_period === 'number') { 3276 4600 if (ourminutes < minutes_from) { 3277 4601 return [false, dateAtDayMinutes(date, minutes_from)]; 3278 4602 } else if (ourminutes <= minutes_to) { 3279 4603 for (var cur_min = minutes_from; ourminutes + point_in_time_period >= cur_min; cur_min += point_in_time_period) { 3280 if (cur_min == ourminutes) {4604 if (cur_min === ourminutes) { 3281 4605 return [true, dateAtDayMinutes(date, ourminutes + 1)]; 3282 4606 } else if (ourminutes < cur_min) { … … 3311 4635 } 3312 4636 3313 if (typeof point_in_time_period == 'number') {4637 if (typeof point_in_time_period === 'number') { 3314 4638 if (ourminutes <= minutes_to) { 3315 4639 for (var cur_min = 0; ourminutes + point_in_time_period >= cur_min; cur_min += point_in_time_period) { 3316 if (cur_min == ourminutes) {4640 if (cur_min === ourminutes) { 3317 4641 return [true, dateAtDayMinutes(date, ourminutes + 1)]; 3318 4642 } else if (ourminutes < cur_min) { … … 3338 4662 var date_to = SunCalc.getTimes(date, lat, lon)[timevar_string[1]]; 3339 4663 minutes_to = date_to.getHours() * 60 + date_to.getMinutes() + timevar_add[1]; 3340 } else if (is_point_in_time && typeof point_in_time_period != 'number') {4664 } else if (is_point_in_time && typeof point_in_time_period !== 'number') { 3341 4665 minutes_to = minutes_from + 1; 3342 4666 } 3343 4667 3344 if (typeof point_in_time_period == 'number') {4668 if (typeof point_in_time_period === 'number') { 3345 4669 if (ourminutes < minutes_from) { 3346 4670 return [false, dateAtDayMinutes(date, minutes_from)]; 3347 4671 } else if (ourminutes <= minutes_to) { 3348 4672 for (var cur_min = minutes_from; ourminutes + point_in_time_period >= cur_min; cur_min += point_in_time_period) { 3349 if (cur_min == ourminutes) {4673 if (cur_min === ourminutes) { 3350 4674 return [true, dateAtDayMinutes(date, ourminutes + 1)]; 3351 4675 } else if (ourminutes < cur_min) { … … 3424 4748 throw formatWarnErrorMessage(nrule, at+1, 'Missing minutes in time range after: "' + tokens[at+1][1] + '"'); 3425 4749 if (matchTokens(tokens, at, 'number')) 3426 throw formatWarnErrorMessage(nrule, at + (typeof tokens[at+1] != 'undefined' ? 1 : 0),4750 throw formatWarnErrorMessage(nrule, at + (typeof tokens[at+1] !== 'undefined' ? 1 : 0), 3427 4751 'Missing time separator in time range after: "' + tokens[at][1] + '"'); 3428 4752 return [ at ]; … … 3468 4792 if (matchTokens(tokens, at+3, 'number', 'timesep', 'number')) { 3469 4793 if (matchTokens(tokens, at+6, ')')) { 3470 var add_or_subtract = tokens[at+2][0] == '+' ? '1' : '-1';4794 var add_or_subtract = tokens[at+2][0] === '+' ? '1' : '-1'; 3471 4795 var minutes = getMinutesByHoursMinutes(tokens, nrule, at+3) * add_or_subtract; 3472 4796 if (minutes === 0) … … 3518 4842 'Number between -5 and 5 (except 0) expected'); 3519 4843 3520 if (from == to) {4844 if (from === to) { 3521 4845 numbers.push(from); 3522 4846 } else if (from < to) { … … 3587 4911 + (number + (number > 0 ? -1 : 0)) * 7 + add_days); 3588 4912 3589 if (date_num == getValueForDate(target_day_with_added_moved_days_this_month, false))4913 if (date_num === getValueForDate(target_day_with_added_moved_days_this_month, false)) 3590 4914 return [true, dateAtDayMinutes(date, minutes_in_day)]; 3591 4915 } else if (add_days < 0) { … … 3600 4924 } else { 3601 4925 if (target_day_with_added_days_this_month.getTime() < start_of_next_month.getTime() 3602 && getValueForDate(target_day_with_added_days_this_month, false) == date_num)4926 && getValueForDate(target_day_with_added_days_this_month, false) === date_num) 3603 4927 return [true, dateAtDayMinutes(date, minutes_in_day)]; 3604 4928 … … 3608 4932 3609 4933 // we hit the target day 3610 if (date.getDate() == target_day_with_added_days_this_month.getDate()) {4934 if (date.getDate() === target_day_with_added_days_this_month.getDate()) { 3611 4935 return [true, dateAtDayMinutes(date, minutes_in_day)]; 3612 4936 } … … 3660 4984 week_stable = false; 3661 4985 return parseHoliday(tokens, at, selectors, true, in_holiday_selector); 4986 } else if (matchTokens(tokens, at - 1, ',')) { // additional rule 4987 throw formatWarnErrorMessage( 4988 nrule, 4989 at - 1, 4990 'An additional rule does not make sense here. Just use a ";" as rule separator.' 4991 + ' See https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#explain:additional_rule_separator'); 3662 4992 } else { 3663 4993 throw formatWarnErrorMessage(nrule, at, 'Unexpected token in weekday range: ' + tokens[at][1]); … … 3719 5049 for (; at < tokens.length; at++) { 3720 5050 if (matchTokens(tokens, at, 'holiday')) { 3721 if (tokens[at][0] == 'PH') {5051 if (tokens[at][0] === 'PH') { 3722 5052 var applying_holidays = getMatchingHoliday(tokens[at][0]); 3723 5053 … … 3746 5076 if (date_num < last_holiday_last_year_num ) { 3747 5077 return [ false, last_holiday_last_year[0] ]; 3748 } else if (date_num == last_holiday_last_year_num) {5078 } else if (date_num === last_holiday_last_year_num) { 3749 5079 return [true, dateAtDayMinutes(last_holiday_last_year[0], minutes_in_day), 3750 5080 'Day after ' +last_holiday_last_year[1] ]; … … 3753 5083 3754 5084 return [ false, holidays[i][0] ]; 3755 } else if (date_num == next_holiday_date_num) {5085 } else if (date_num === next_holiday_date_num) { 3756 5086 return [true, new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1), 3757 5087 (add_days[0] > 0 ? 'Day after ' : (add_days[0] < 0 ? 'Day before ' : '')) + holidays[i][1] ]; … … 3764 5094 var first_holidays_next_year = holidays_next_year[0]; 3765 5095 var first_holidays_next_year_num = getValueForDate(first_holidays_next_year[0], true); 3766 if (date_num == first_holidays_next_year_num) {5096 if (date_num === first_holidays_next_year_num) { 3767 5097 return [true, dateAtDayMinutes(first_holidays_next_year[0], minutes_in_day), 3768 5098 'Day before ' + first_holidays_next_year[1] ]; … … 3783 5113 3784 5114 at += 1 + add_days[1]; 3785 } else if (tokens[at][0] == 'SH') {5115 } else if (tokens[at][0] === 'SH') { 3786 5116 var applying_holidays = getMatchingHoliday(tokens[at][0]); 3787 5117 … … 3808 5138 // check if we are in the holidays from the last year spanning into this year 3809 5139 var last_year_holiday = getSHForYear(applying_holidays[applying_holidays.length - 1], date.getFullYear() - 1, false); 3810 if (typeof last_year_holiday != 'undefined') {5140 if (typeof last_year_holiday !== 'undefined') { 3811 5141 var last_year_holiday_from = (last_year_holiday[last_year_holiday.length - 4] - 1) * 100 3812 5142 + last_year_holiday[last_year_holiday.length - 3]; // e.g. 1125 … … 3827 5157 return [ true, new Date(date.getFullYear() + holiday_ends_next_year, holiday[2+h] - 1, holiday[3+h] + 1), 3828 5158 applying_holidays[i].name ]; 3829 } else if (holiday_to_plus == date_num) { // selected holiday end is equal to month and day5159 } else if (holiday_to_plus === date_num) { // selected holiday end is equal to month and day 3830 5160 if (h + 4 < holiday.length) { // next holiday is next date range of the same holidays 3831 5161 h += 4; 3832 5162 return [ false, new Date(date.getFullYear(), holiday[0+h] - 1, holiday[1+h]) ]; 3833 5163 } else { 3834 if (i + 1 == applying_holidays.length) { // last holidays are handled, continue all over again5164 if (i + 1 === applying_holidays.length) { // last holidays are handled, continue all over again 3835 5165 var holiday = getSHForYear(applying_holidays[0], date.getFullYear() + 1); 3836 5166 return [ false, new Date(date.getFullYear() + !holiday_ends_next_year, holiday[0+h] - 1, holiday[1+h]) ]; … … 3850 5180 else 3851 5181 selectors.holiday.push(selector); 3852 at += 1; 5182 at += 1; // FIXME: test 3853 5183 } 3854 5184 } else if (matchTokens(tokens, at, 'weekday')) { 3855 5185 return parseWeekdayRange(tokens, at, selectors, true); 5186 } else if (matchTokens(tokens, at - 1, ',')) { // additional rule 5187 throw formatWarnErrorMessage( 5188 nrule, 5189 at - 1, 5190 'An additional rule does not make sense here. Just use a ";" as rule separator.' 5191 + ' See https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#explain:additional_rule_separator'); 3856 5192 } else { 3857 throw formatWarnErrorMessage(nrule, at, 'Unexpected token ( schoolholiday parser): ' + tokens[at][1]);5193 throw formatWarnErrorMessage(nrule, at, 'Unexpected token (holiday parser): ' + tokens[at][1]); 3858 5194 } 3859 5195 … … 3877 5213 function getValueForDate(date, include_year) { 3878 5214 // Implicit because undefined evaluates to false. 3879 // include_year = typeof include_year != 'undefined' ? include_year : false;5215 // include_year = typeof include_year !== 'undefined' ? include_year : false; 3880 5216 3881 5217 return (include_year ? date.getFullYear() * 10000 : 0) + date.getMonth() * 100 + date.getDate(); … … 3886 5222 // for the specified year 3887 5223 function getSHForYear(SH_hash, year, fatal) { 3888 if (typeof fatal == 'undefined')5224 if (typeof fatal === 'undefined') 3889 5225 fatal = true; 3890 5226 3891 5227 var holiday = SH_hash[year]; 3892 if (typeof holiday == 'undefined') {5228 if (typeof holiday === 'undefined') { 3893 5229 holiday = SH_hash['default']; // applies for any year without explicit definition 3894 if (typeof holiday == 'undefined') {5230 if (typeof holiday === 'undefined') { 3895 5231 if (fatal) { 3896 5232 throw formatLibraryBugMessage('School holiday ' + SH_hash.name + ' has no definition for the year ' + year + '.' … … 3908 5244 // (which can be limited to some states). 3909 5245 function getMatchingHoliday(type_of_holidays) { 3910 if (typeof location_cc != 'undefined') {5246 if (typeof location_cc !== 'undefined') { 3911 5247 if (holidays.hasOwnProperty(location_cc)) { 3912 if (typeof location_state != 'undefined') { 3913 if (holidays[location_cc][location_state] 3914 && holidays[location_cc][location_state][type_of_holidays]) { 3915 // if holidays for the state are specified use it 3916 // and ignore lesser specific ones (for the country) 3917 return holidays[location_cc][location_state][type_of_holidays]; 3918 } else if (holidays[location_cc][type_of_holidays]) { 3919 // holidays are only defined country wide 3920 var matching_holiday = {}; // holidays in the country wide scope can be limited to certain states 3921 for (var holiday_name in holidays[location_cc][type_of_holidays]) { 3922 if (typeof holidays[location_cc][type_of_holidays][holiday_name][2] === 'object') { 3923 if (-1 != holidays[location_cc][type_of_holidays][holiday_name][2].indexOf(location_state)) 3924 matching_holiday[holiday_name] = holidays[location_cc][type_of_holidays][holiday_name]; 3925 } else { 5248 if (typeof location_state !== 'undefined' 5249 && holidays[location_cc][location_state] 5250 && holidays[location_cc][location_state][type_of_holidays]) { 5251 // if holidays for the state are specified use it 5252 // and ignore lesser specific ones (for the country) 5253 return holidays[location_cc][location_state][type_of_holidays]; 5254 } else if (holidays[location_cc][type_of_holidays]) { 5255 // holidays are only defined country wide 5256 var matching_holiday = {}; // holidays in the country wide scope can be limited to certain states 5257 for (var holiday_name in holidays[location_cc][type_of_holidays]) { 5258 if (typeof holidays[location_cc][type_of_holidays][holiday_name][2] === 'object') { 5259 if (-1 !== holidays[location_cc][type_of_holidays][holiday_name][2].indexOf(location_state)) 3926 5260 matching_holiday[holiday_name] = holidays[location_cc][type_of_holidays][holiday_name]; 3927 } 5261 } else { 5262 matching_holiday[holiday_name] = holidays[location_cc][type_of_holidays][holiday_name]; 3928 5263 } 3929 if (Object.keys(matching_holiday).length === 0)3930 throw formatLibraryBugMessage('There are no holidays ' + type_of_holidays + ' defined for country ' + location_cc + '.'3931 + ' You can also add them: ' + repository_url);3932 return matching_holiday;3933 } else {3934 throw formatLibraryBugMessage('Holidays ' + type_of_holidays + ' are not defined for country ' + location_cc3935 + ' and state ' + location_state + '.'3936 + ' You can also add them: ' + repository_url);3937 5264 } 5265 if (Object.keys(matching_holiday).length === 0) 5266 throw formatLibraryBugMessage('There are no holidays ' + type_of_holidays + ' defined for country ' + location_cc + '.' 5267 + ' You can also add them: ' + repository_url); 5268 return matching_holiday; 5269 } else { 5270 throw formatLibraryBugMessage('Holidays ' + type_of_holidays + ' are not defined for country ' + location_cc 5271 + ' and state ' + location_state + '.' 5272 + ' You can also add them: ' + repository_url); 3938 5273 } 3939 5274 } else { … … 3941 5276 + ' You can also add them: ' + repository_url); 3942 5277 } 3943 } else { / / we have no idea which holidays do apply because the country code was not provided5278 } else { /* We have no idea which holidays do apply because the country code was not provided. */ 3944 5279 throw 'Country code missing which is needed to select the correct holidays (see README how to provide it)'; 3945 5280 } … … 3991 5326 var canadaDay = july_1.getDay() === 0 ? 2 : 1; 3992 5327 3993 // calculate first Monday for each month 3994 var firstMondays = {}; 3995 for (var i = 0; i < 12; i++) { 3996 var first = new Date(Y, i, 1); 3997 var firstMonday = 1 + ((8 - first.getDay()) % 7); 3998 firstMondays[i] = firstMonday; 5328 function firstWeekdayOfMonth(month, weekday){ 5329 var first = new Date(Y, month, 1); 5330 return 1 + ((7 + weekday - first.getDay()) % 7); 3999 5331 } 4000 5332 5333 function lastWeekdayOfMonth(month, weekday){ 5334 var last = new Date(Y, month+1, 0); 5335 var offset=((7 + last.getDay() - weekday) % 7); 5336 return last.getDate() - offset; 5337 } 5338 4001 5339 return { 4002 'firstFebruaryMonday': new Date(Y, 1, firstMondays[1]), 4003 'lastFebruarySunday': new Date(Y, 1, lastFebruarySunday), 4004 'easter': new Date(Y, M - 1, D), 4005 'victoriaDay': new Date(Y, 4, victoriaDay), 4006 'canadaDay': new Date(Y, 6, canadaDay), 4007 'firstAugustMonday': new Date(Y, 7, firstMondays[7]), 4008 'firstSeptemberMonday': new Date(Y, 8, firstMondays[8]), 4009 'firstOctoberMonday': new Date(Y, 9, firstMondays[9]), 4010 'orthodox easter' : oDate, 5340 'easter' : new Date(Y, M - 1, D), 5341 'orthodox easter' : oDate, 5342 'victoriaDay' : new Date(Y, 4, victoriaDay), 5343 'canadaDay' : new Date(Y, 6, canadaDay), 5344 'firstJanuaryMonday' : new Date(Y, 0, firstWeekdayOfMonth(0, 1)), 5345 'firstFebruaryMonday' : new Date(Y, 1, firstWeekdayOfMonth(1, 1)), 5346 'lastFebruarySunday' : new Date(Y, 1, lastFebruarySunday), 5347 'firstMarchMonday' : new Date(Y, 2, firstWeekdayOfMonth(2, 1)), 5348 'firstAprilMonday' : new Date(Y, 3, firstWeekdayOfMonth(3, 1)), 5349 'firstMayMonday' : new Date(Y, 4, firstWeekdayOfMonth(4, 1)), 5350 'firstJuneMonday' : new Date(Y, 5, firstWeekdayOfMonth(5, 1)), 5351 'firstJulyMonday' : new Date(Y, 6, firstWeekdayOfMonth(6, 1)), 5352 'firstAugustMonday' : new Date(Y, 7, firstWeekdayOfMonth(7, 1)), 5353 'firstSeptemberMonday' : new Date(Y, 8, firstWeekdayOfMonth(8, 1)), 5354 'firstSeptemberSunday' : new Date(Y, 8, firstWeekdayOfMonth(8, 0)), 5355 'firstOctoberMonday' : new Date(Y, 9, firstWeekdayOfMonth(9, 1)), 5356 'firstNovemberMonday' : new Date(Y, 10, firstWeekdayOfMonth(10, 1)), 5357 'firstMarchTuesday' : new Date(Y, 2, firstWeekdayOfMonth(2, 2)), 5358 'firstAugustTuesday' : new Date(Y, 7, firstWeekdayOfMonth(7, 2)), 5359 'firstAugustFriday' : new Date(Y, 7, firstWeekdayOfMonth(7, 5)), 5360 'firstNovemberThursday' : new Date(Y, 10, firstWeekdayOfMonth(10, 4)), 5361 'lastMayMonday' : new Date(Y, 4, lastWeekdayOfMonth(4, 1)), 5362 'lastMarchMonday' : new Date(Y, 2, lastWeekdayOfMonth(2, 1)), 5363 'lastAprilMonday' : new Date(Y, 3, lastWeekdayOfMonth(3, 1)), 5364 'lastAprilFriday' : new Date(Y, 3, lastWeekdayOfMonth(3, 5)), 5365 'lastOctoberFriday' : new Date(Y, 9, lastWeekdayOfMonth(9, 5)), 4011 5366 }; 4012 5367 } … … 4019 5374 4020 5375 for (var holiday_name in applying_holidays) { 4021 if (typeof applying_holidays[holiday_name][0] == 'string') {5376 if (typeof applying_holidays[holiday_name][0] === 'string') { 4022 5377 var selected_movableDay = movableDays[applying_holidays[holiday_name][0]]; 4023 5378 if (!selected_movableDay) … … 4029 5384 + applying_holidays[holiday_name][1] 4030 5385 ); 4031 if (year != next_holiday.getFullYear())5386 if (year !== next_holiday.getFullYear()) 4032 5387 throw 'The movable day ' + applying_holidays[holiday_name][0] + ' plus ' 4033 5388 + applying_holidays[holiday_name][1] … … 4089 5444 // error checking {{{ 4090 5445 if (is_range && tokens[at+2][0] <= year_from) { 4091 // handle reversed range 4092 if (tokens[at+2][0] == year_from) 4093 throw formatWarnErrorMessage(nrule, at, 4094 'A year range in which the start year is equal to the end year does not make sense.' 4095 + ' Please remove the end year. E.g. "' + year_from + ' May 23"'); 4096 else 4097 throw formatWarnErrorMessage(nrule, at, 4098 'A year range in which the start year is greater than the end year does not make sense.' 4099 + ' Please turn it over.'); 5446 // handle reversed range 5447 if (tokens[at+2][0] === year_from) { 5448 throw formatWarnErrorMessage(nrule, at, 5449 'A year range in which the start year is equal to the end year does not make sense.' 5450 + ' Please remove the end year. E.g. "' + year_from + ' May 23"'); 5451 } else { 5452 throw formatWarnErrorMessage(nrule, at, 5453 'A year range in which the start year is greater than the end year does not make sense.' 5454 + ' Please turn it over.'); 5455 } 4100 5456 } 4101 5457 // }}} … … 4122 5478 if (ouryear <= year_to) 4123 5479 return [true, new Date(year_to + 1, 0, 1)]; 4124 } else if (ouryear == year_from) {5480 } else if (ouryear === year_from) { 4125 5481 return [true]; 4126 5482 } … … 4130 5486 }}(tokens, at, year_from, is_range, has_period, period)); 4131 5487 4132 at += 1 + (is_range ? 2 : 0) + (has_period ? (has_period == 2 ? 1 : 2) : 0); 5488 at += 1 + (is_range ? 2 : 0) + (has_period ? (has_period === 2 ? 1 : 2) : 0); 5489 } else if (matchTokens(tokens, at - 1, ',')) { // additional rule 5490 throw formatWarnErrorMessage( 5491 nrule, 5492 at - 1, 5493 'An additional rule does not make sense here. Just use a ";" as rule separator.' 5494 + ' See https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#explain:additional_rule_separator'); 4133 5495 } else { 4134 5496 throw formatWarnErrorMessage(nrule, at, 'Unexpected token in year range: ' + tokens[at][1]); … … 4191 5553 } 4192 5554 4193 if (!period && week_from == 1 && week_to== 53) {5555 if (!period && week_from === 1 && week_to === 53) { 4194 5556 /* Shortcut and work around bug. */ 4195 5557 selectors.week.push(function(date) { return [true]; }); … … 4225 5587 4226 5588 // console.log("Match"); 4227 return [true, getNextDateOfISOWeek(week_to == 53 ? 1 : week_to + 1, date)];5589 return [true, getNextDateOfISOWeek(week_to === 53 ? 1 : week_to + 1, date)]; 4228 5590 }}(week_from, week_to, is_range, period)); 4229 5591 } 4230 5592 4231 5593 at += 1 + (is_range ? 2 : 0) + (period ? 2 : 0); 5594 } else if (matchTokens(tokens, at - 1, ',')) { // additional rule 5595 throw formatWarnErrorMessage( 5596 nrule, 5597 at - 1, 5598 'An additional rule does not make sense here. Just use a ";" as rule separator.' 5599 + ' See https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#explain:additional_rule_separator'); 4232 5600 } else { 4233 5601 throw formatWarnErrorMessage(nrule, at, 'Unexpected token in week range: ' + tokens[at][1]); … … 4393 5761 has_constrained_weekday[0] = getConstrainedWeekday(tokens, at+has_year[0]+3); 4394 5762 has_calc[0] = getMoveDays(tokens, has_constrained_weekday[0][1], 6, 'constrained weekdays'); 4395 at_range_sep = has_constrained_weekday[0][1] + (typeof has_calc[0] != 'undefined' && has_calc[0][1] ? 3 : 0);5763 at_range_sep = has_constrained_weekday[0][1] + (typeof has_calc[0] !== 'undefined' && has_calc[0][1] ? 3 : 0); 4396 5764 } else { 4397 5765 at_range_sep = at+has_year[0] 4398 5766 + (has_event[0] 4399 ? (typeof has_calc[0] != 'undefined' && has_calc[0][1] ? 4 : 1)5767 ? (typeof has_calc[0] !== 'undefined' && has_calc[0][1] ? 4 : 1) 4400 5768 : 2); 4401 5769 } … … 4418 5786 4419 5787 // monthday range like Jan 26-Feb 26 {{{ 4420 if (has_year[0] == has_year[1] && (has_month[1] || has_event[1] || has_constrained_weekday[1])) {5788 if (has_year[0] === has_year[1] && (has_month[1] || has_event[1] || has_constrained_weekday[1])) { 4421 5789 4422 5790 if (has_month[0]) … … 4434 5802 from_date = movableDays[tokens[at+has_year[0]][0]]; 4435 5803 4436 if (typeof has_calc[0] != 'undefined' && has_calc[0][1]) {5804 if (typeof has_calc[0] !== 'undefined' && has_calc[0][1]) { 4437 5805 var from_year_before_calc = from_date.getFullYear(); 4438 5806 from_date.setDate(from_date.getDate() + has_calc[0][0]); 4439 if (from_year_before_calc != from_date.getFullYear())5807 if (from_year_before_calc !== from_date.getFullYear()) 4440 5808 throw formatWarnErrorMessage(nrule, at+has_year[0]+has_calc[0][1]*3, 4441 5809 'The movable day ' + tokens[at+has_year[0]][0] + ' plus ' + has_calc[0][0] … … 4460 5828 to_date = movableDays[tokens[at_sec_event_or_month][0]]; 4461 5829 4462 if (typeof has_calc[1] != 'undefined' && has_calc[1][1]) {5830 if (typeof has_calc[1] !== 'undefined' && has_calc[1][1]) { 4463 5831 var to_year_before_calc = to_date.getFullYear(); 4464 5832 to_date.setDate(to_date.getDate() + has_calc[1][0]); 4465 if (to_year_before_calc != to_date.getFullYear())5833 if (to_year_before_calc !== to_date.getFullYear()) 4466 5834 throw formatWarnErrorMessage(nrule, at_sec_event_or_month+has_calc[1][1], 4467 5835 'The movable day ' + tokens[at_sec_event_or_month][0] + ' plus ' + has_calc[1][0] … … 4509 5877 ? has_constrained_weekday[1][1] 4510 5878 : at_sec_event_or_month + (has_event[1] ? 1 : 2)) 4511 + (typeof has_calc[1] != 'undefined' ? has_calc[1][1] : 0);5879 + (typeof has_calc[1] !== 'undefined' ? has_calc[1][1] : 0); 4512 5880 4513 5881 // }}} … … 4560 5928 var from_date = new Date(has_year ? year : date.getFullYear(), 4561 5929 month, range_from); 4562 if (month == 1 && range_from != from_date.getDate()) // Only on leap years does this day exist.5930 if (month === 1 && range_from !== from_date.getDate()) // Only on leap years does this day exist. 4563 5931 return [false]; // If day 29 does not exist, 4564 5932 // then the date object adds one day to date … … 4566 5934 var to_date = new Date(from_date.getFullYear(), 4567 5935 month, range_to); 4568 if (month == 1 && is_range && range_to != to_date.getDate()) // Only on leap years does this day exist.5936 if (month === 1 && is_range && range_to !== to_date.getDate()) // Only on leap years does this day exist. 4569 5937 return [false]; 4570 5938 … … 4613 5981 if (add_days[0]) { 4614 5982 event_date.setDate(event_date.getDate() + add_days[0]); 4615 if (date.getFullYear() != event_date.getFullYear())5983 if (date.getFullYear() !== event_date.getFullYear()) 4616 5984 throw formatWarnErrorMessage(nrule, at+has_year+add_days[1], 'The movable day ' + tokens[at+has_year][0] + ' plus ' 4617 5985 + add_days[0] … … 4622 5990 return [false, event_date]; 4623 5991 // else if (date.getTime() < event_date.getTime() + msec_in_day) // does not work because of daylight saving times 4624 else if (event_date.getMonth() * 100 + event_date.getDate() == date.getMonth() * 100 + date.getDate())5992 else if (event_date.getMonth() * 100 + event_date.getDate() === date.getMonth() * 100 + date.getDate()) 4625 5993 return [true, new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1)]; 4626 5994 else … … 4634 6002 selectors.monthday.push(selector); 4635 6003 4636 at += has_year[0] + has_event[0] + (typeof has_calc[0][1] != 'undefined' && has_calc[0][1] ? 3 : 0);6004 at += has_year[0] + has_event[0] + (typeof has_calc[0][1] !== 'undefined' && has_calc[0][1] ? 3 : 0); 4637 6005 // }}} 4638 6006 } else if (has_constrained_weekday[0]) { … … 4673 6041 var date_matching_rules = []; 4674 6042 6043 /* Go though all date selectors and check if they return something 6044 * else than closed for the given date. 6045 */ 4675 6046 for (var nrule = 0; nrule < rules.length; nrule++) { 4676 6047 var matching_date_rule = true; 4677 6048 // console.log(nrule, 'length', rules[nrule].date.length); 4678 6049 4679 / / Try each date selector type6050 /* Try each date selector type. */ 4680 6051 for (var ndateselector = 0; ndateselector < rules[nrule].date.length; ndateselector++) { 4681 6052 var dateselectors = rules[nrule].date[ndateselector]; … … 4688 6059 has_matching_selector = true; 4689 6060 4690 if (typeof res[2] == 'string') { // holiday name4691 comment = [ res[2] ];6061 if (typeof res[2] === 'string') { // holiday name 6062 comment = [ res[2], nrule ]; 4692 6063 } 4693 6064 … … 4706 6077 break; 4707 6078 } 4708 4709 6079 } 4710 6080 4711 6081 if (matching_date_rule) { 4712 // The following lines implement date overwriting logic (e.g. for 4713 // "Mo-Fr 10:00-20:00; We 10:00-16:00", We rule overrides Mo-Fr rule partly (We). 4714 // 4715 // This is the only way to be consistent. I thought about ("22:00-02:00; Tu 12:00-14:00") letting Th override 22:00-02:00 partly: 4716 // Like: Th 00:00-02:00,12:00-14:00 but this would result in including 22:00-00:00 for Th which is probably not what you want. 6082 /* The following lines implement date overwriting logic (e.g. for 6083 * "Mo-Fr 10:00-20:00; We 10:00-16:00", We rule overrides Mo-Fr rule partly (We). 6084 * 6085 * This is the only way to be consistent. I thought about ("22:00-02:00; Tu 12:00-14:00") letting Th override 22:00-02:00 partly: 6086 * Like: Th 00:00-02:00,12:00-14:00 but this would result in including 22:00-00:00 for Th which is probably not what you want. 6087 */ 4717 6088 if ((rules[nrule].date.length > 0 || nrule > 0 && rules[nrule].meaning && rules[nrule-1].date.length === 0) 4718 6089 && (rules[nrule].meaning || rules[nrule].unknown) … … 4731 6102 } 4732 6103 6104 // console.log(date_matching_rules); 4733 6105 rule: 4734 6106 for (var nrule = 0; nrule < date_matching_rules.length; nrule++) { … … 4738 6110 // + ' and ' + rules[rule].time.length + ' time selectors (comment: "' + rules[rule].comment + '").'); 4739 6111 4740 / / there is no time specified, state applies to the whole day6112 /* There is no time specified, state applies to the whole day. */ 4741 6113 if (rules[rule].time.length === 0) { 4742 6114 // console.log('there is no time', date); … … 4744 6116 resultstate = rules[rule].meaning; 4745 6117 unknown = rules[rule].unknown; 4746 match_rule = rule; 4747 4748 if (typeof rules[rule].comment != 'undefined') 4749 comment = rules[rule].comment; 4750 else if (typeof comment == 'object') // holiday name 4751 comment = comment[0]; 6118 match_rule = rule; 4752 6119 4753 6120 // if (rules[rule].fallback) … … 4767 6134 match_rule = rule; 4768 6135 4769 if (typeof rules[rule].comment == 'string') // only use comment if one is specified 4770 comment = rules[rule].comment; 4771 else if (typeof comment == 'object') // holiday name 4772 comment = comment[0]; 4773 else if (comment === 'Specified as open end. Closing time was guessed.') 4774 comment = rules[rule].comment; 6136 /* Reset open end comment */ 6137 if (typeof comment === 'object' && comment[0] === 'Specified as open end. Closing time was guessed.') 6138 comment = undefined; 4775 6139 4776 6140 // open end 4777 6141 if (res[2] === true && (resultstate || unknown)) { 4778 if (typeof comment == 'undefined') 4779 comment = 'Specified as open end. Closing time was guessed.'; 6142 comment = [ 'Specified as open end. Closing time was guessed.', match_rule ]; 4780 6143 4781 6144 resultstate = false; … … 4783 6146 4784 6147 /* Hack to make second rule in '07:00+,12:00-16:00; 16:00-24:00 closed "needed because of open end"' obsolete {{{ */ 4785 if (typeof rules[rule].time[timesel+1] == 'function') {6148 if (typeof rules[rule].time[timesel+1] === 'function') { 4786 6149 4787 6150 var next_res = rules[rule].time[timesel+1](date); 4788 6151 if ( !next_res[0] 4789 6152 // && next_res[2] 4790 && typeof next_res[1] == 'object'4791 // && getValueForDate(next_res[1], true) != getValueForDate(date, true) // Just to be sure.6153 && typeof next_res[1] === 'object' 6154 // && getValueForDate(next_res[1], true) !== getValueForDate(date, true) // Just to be sure. 4792 6155 && rules[rule].time[timesel](new Date(date.getTime() - 1))[0] 4793 /* To keep the following two apart:6156 /* To distinguish the following two values: 4794 6157 * 'sunrise-14:00,14:00+', 4795 6158 * '07:00+,12:00-16:00', … … 4813 6176 */ 4814 6177 if ( false 4815 && typeof rules[rule-1] == 'object'4816 && rules[rule].build_from_token_rule.toString() == rules[rule-1].build_from_token_rule.toString()4817 && typeof rules[rule] == 'object'4818 && rules[rule].build_from_token_rule.toString() == rules[rule].build_from_token_rule.toString()6178 && typeof rules[rule-1] === 'object' 6179 && rules[rule].build_from_token_rule.toString() === rules[rule-1].build_from_token_rule.toString() 6180 && typeof rules[rule] === 'object' 6181 && rules[rule].build_from_token_rule.toString() === rules[rule].build_from_token_rule.toString() 4819 6182 ) { 4820 6183 … … 4824 6187 4825 6188 if ( last_w_res[0] 4826 && typeof last_w_res[2]== 'undefined'4827 && (typeof last_w_res[2] == 'undefined' || last_w_res[2] === false) // Not match for 'Tu 23:59-40:00+'4828 && typeof last_w_res[1] == 'object'4829 && date.getTime() == last_w_res[1].getTime()6189 && typeof last_w_res[2] === 'undefined' 6190 && (typeof last_w_res[2] === 'undefined' || last_w_res[2] === false) // Do not match for 'Tu 23:59-40:00+' 6191 && typeof last_w_res[1] === 'object' 6192 && date.getTime() === last_w_res[1].getTime() 4830 6193 ) { 4831 6194 … … 4854 6217 if (typeof changedate === 'undefined' || (typeof res[1] !== 'undefined' && res[1] < changedate)) 4855 6218 changedate = res[1]; 6219 } 6220 } 6221 6222 if (typeof rules[match_rule] === 'object' && typeof rules[match_rule].comment === 'string') { 6223 /* Only use comment if one is explicitly specified. */ 6224 comment = rules[match_rule].comment; 6225 } else if (typeof comment === 'object') { 6226 if (comment[1] === match_rule) { 6227 comment = comment[0]; 6228 } else { 6229 comment = undefined; 4856 6230 } 4857 6231 } … … 4880 6254 && at - selector_start > 1 && (matchTokens(tokens, at-1, ',') || matchTokens(tokens, at-1, '-')) 4881 6255 && matchTokens(tokens, at-2, 'weekday') 4882 && tokens[at][0] == (tokens[at-2][0] + 1) % 7) {6256 && tokens[at][0] === (tokens[at-2][0] + 1) % 7) { 4883 6257 value = value.substring(0, value.length - 1) + conf.sep_one_day_between; 4884 6258 } 4885 6259 value += weekdays[tokens[at][0]]; 4886 6260 } else if (at - selector_start > 0 // e.g. '09:0' -> '09:00' 4887 && selector_type == 'time'6261 && selector_type === 'time' 4888 6262 && matchTokens(tokens, at-1, 'timesep') 4889 6263 && matchTokens(tokens, at, 'number')) { 4890 6264 value += (tokens[at][0] < 10 ? '0' : '') + tokens[at][0].toString(); 4891 } else if (selector_type == 'time' // e.g. '9:00' -> ' 09:00'6265 } else if (selector_type === 'time' // e.g. '9:00' -> ' 09:00' 4892 6266 && conf.zero_pad_hour 4893 && at != tokens.length6267 && at !== tokens.length 4894 6268 && matchTokens(tokens, at, 'number') 4895 6269 && matchTokens(tokens, at+1, 'timesep')) { … … 4899 6273 '' : '0') : 4900 6274 '') + tokens[at][0].toString(); 4901 } else if (selector_type == 'time' // e.g. '9-18' -> '09:00-18:00'6275 } else if (selector_type === 'time' // e.g. '9-18' -> '09:00-18:00' 4902 6276 && at + 2 <= selector_end 4903 6277 && matchTokens(tokens, at, 'number') … … 4916 6290 value += (conf.leave_off_closed ? tokens[at][0] : conf.keyword_for_off_closed); 4917 6291 } else if (at - selector_start > 0 && matchTokens(tokens, at, 'number') 4918 && (matchTokens(tokens, at-1, 'month') && selector_type == 'month'4919 || matchTokens(tokens, at-1, 'week') && selector_type == 'week'6292 && (matchTokens(tokens, at-1, 'month') && selector_type === 'month' 6293 || matchTokens(tokens, at-1, 'week') && selector_type === 'week' 4920 6294 )) { 4921 6295 value += ' ' … … 4935 6309 && (matchTokens(tokens, at, '-') || matchTokens(tokens, at, '+')) 4936 6310 && matchTokens(tokens, at+1, 'number', 'calcday')) { 4937 value += ' ' + tokens[at][0] + tokens[at+1][0] + ' day' + (Math.abs(tokens[at+1][0]) == 1 ? '' : 's');6311 value += ' ' + tokens[at][0] + tokens[at+1][0] + ' day' + (Math.abs(tokens[at+1][0]) === 1 ? '' : 's'); 4938 6312 at += 2; 4939 } else if (at == selector_end4940 && selector_type == 'weekday'4941 && tokens[at][0] == ':') {6313 } else if (at === selector_end 6314 && selector_type === 'weekday' 6315 && tokens[at][0] === ':') { 4942 6316 // Do nothing. 4943 6317 } else { … … 4972 6346 /* setDate {{{ */ 4973 6347 this.setDate = function(date) { 4974 if (typeof date != 'object')6348 if (typeof date !== 'object') 4975 6349 throw 'Date parameter needed.'; 4976 6350 … … 5006 6380 /* getMatchingRule: Get the rule which matched thus deterrents the current state {{{ */ 5007 6381 this.getMatchingRule = function() { 5008 if (typeof state[4] == 'undefined')6382 if (typeof state[4] === 'undefined') 5009 6383 return undefined; 5010 6384 … … 5130 6504 while (it.advance(to)) { 5131 6505 if (it.getState() || it.getUnknown()) { 5132 if (res.length !== 0 && typeof res[res.length - 1][1] == 'undefined') {6506 if (res.length !== 0 && typeof res[res.length - 1][1] === 'undefined') { 5133 6507 // last state was also open or unknown 5134 6508 res[res.length - 1][1] = it.getDate(); … … 5136 6510 res.push([it.getDate(), undefined, it.getUnknown(), it.getComment()]); 5137 6511 } else { 5138 if (res.length !== 0 && typeof res[res.length - 1][1] == 'undefined') {6512 if (res.length !== 0 && typeof res[res.length - 1][1] === 'undefined') { 5139 6513 // only use the first time as closing/change time and ignore closing times which might follow 5140 6514 res[res.length - 1][1] = it.getDate();
Note:
See TracChangeset
for help on using the changeset viewer.