Changeset 8223 in josm


Ignore:
Timestamp:
2015-04-18T17:25:14+02:00 (9 years ago)
Author:
simon04
Message:

fix #11337 - Update opening_hours.js to v3.1.1

https://github.com/ypid/opening_hours.js/raw/v3.1.1/opening_hours.js

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/validator/opening_hours.js

    r7537 r8223  
    88
    99(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         */
    1220        var holidays = {
    1321                'fr': { // {{{
    1422                        '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' ] ]
    3745                        }
    3846                }, // }}}
     
    13091317                        },
    13101318                }, // }}}
     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                }, // }}}
    13111747                'ua': { // {{{
    13121748                        '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
     
    13201756                                "День Конституції України"  : [  6, 28 ],
    13211757                                "День Незалежності України" : [  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                                }
    13222618                        }
    13232619                }, // }}}
     
    13372633                                'dan spomina na mrtve'                      : [ 11,  1 ],
    13382634                                '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 ],
    13402653                        },
    13412654                }, // }}}
     
    14052718                                'til late': '+',
    14062719                                'till late': '+',
     2720                                'bis open end': '+',
    14072721                                '-late': '+',
    14082722                                '-open end': '+',
     
    14972811                                'geöffnet': '',
    14982812                                'zwischen': '',
     2813                                'ist': '',
     2814                                'durchgehend': '',
    14992815                        }, 'Bitte verzichte auf "<ko>". Sie möchten eventuell eine Öffnungszeit ohne vorgegebenes Ende (Open End) angeben. Beispiel: "12:00+"': {
    15002816                                'ab':  '',
     
    15072823                                'täglich':     'Mo-Su',
    15082824                                'schulferien': 'SH',
     2825                                'sonn und feiertag':   'PH,Su',
     2826                                'sonn und feiertags':  'PH,Su',
     2827                                'sonn- und feiertags': 'PH,Su',
    15092828                                'sonn-/feiertag':      'PH,Su',
    15102829                                'sonn-/feiertags':     'PH,Su',
    15112830                                'an sonn- und feiertagen': 'PH,Su',
    15122831                                '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.': {
    15142834                                '„': '"',
    15152835                                '“': '"',
    15162836                                '”': '"',
    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.': {
    15182838                                '«': '"',
    15192839                                '»': '"',
     
    15252845                                '『': '"',
    15262846                                '』': '"',
    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.': {
    15282848                                "'": '"',
    15292849                        }, 'You might want to use comments instead of brackets (which are not valid in this context). If you do, replace "<ok>" with "<ko>".': {
     
    16632983                                'son':         0,
    16642984                                'sonntag':     0,
    1665                                 'sonn-':     0,
     2985                                'sonn-':       0,
    16662986                                'sonntags':    0,
    16672987                                'montag':      1,
     
    16752995                                'mittwoch':    3,
    16762996                                'mittwochs':   3,
    1677                                 'do':        4,
     2997                                'do':          4,
    16782998                                'don':         4,
    16792999                                'donnerstag':  4,
     
    18713191                // holidays.
    18723192                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                                }
    18783203                        }
    18793204
    1880                         if (typeof nominatiomJSON.lon != 'undefined') { // lat will be tested later …
     3205                        if (typeof nominatiomJSON.lon !== 'undefined') { // lat will be tested later …
    18813206                                lat = nominatiomJSON.lat;
    18823207                                lon = nominatiomJSON.lon;
     
    18873212                // 1: points in time
    18883213                // 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') {
    18903215                        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))) {
    18923217                        throw 'The third constructor parameter is oh_mode and must be a number (0, 1 or 2)';
    18933218                }
     
    19153240                                parsing_warnings.push([nrule, -1,
    19163241                                        '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] ?
    19183243                                                ' Might it be possible that you are a programmer and adding a semicolon after each statement is hardwired in your muscle memory ;) ?'
    19193244                                                + ' The thing is that the semicolon in the opening_hours syntax is defined as rule separator.'
     
    19263251                        var next_rule_is_additional = false;
    19273252                        do {
    1928                                 if (continue_at == tokens[nrule][0].length) break;
     3253                                if (continue_at === tokens[nrule][0].length) break;
    19293254                                // Additional rule does contain nothing useful e.g. second rule of '10:00-12:00,' (empty) which needs to be handled.
    19303255
     
    19573282                                selectors.build_from_token_rule = [ nrule, continue_at, new_tokens.length ];
    19583283                                continue_at = parseGroup(tokens[nrule][0], continue_at, selectors, nrule);
    1959                                 if (typeof continue_at == 'object') {
     3284                                if (typeof continue_at === 'object') {
    19603285                                        continue_at = continue_at[0];
    19613286                                } else {
     
    20133338
    20143339                                                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,
    20173341                                        };
    20183342
     
    20433367                function formatWarnErrorMessage(nrule, at, message) {
    20443368                        // FIXME: Change to new_tokens.
    2045                         if (typeof nrule == 'number') {
     3369                        if (typeof nrule === 'number') {
    20463370                                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.
    20483372                                        pos = value.length - at;
    20493373                                } 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) {
    20523376                                                        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') {
    20543378                                                                pos -= tokens[nrule+1][2];
    2055                                                         } else if (typeof tokens[nrule][2] == 'number') {
     3379                                                        } else if (typeof tokens[nrule][2] === 'number') {
    20563380                                                                pos -= tokens[nrule][2];
    20573381                                                        }
     
    20613385                                                        formatLibraryBugMessage('Bug in warning generation code which could not determine the exact position of the warning or error in value.');
    20623386                                                        pos = value.length;
    2063                                                         if (typeof tokens[nrule][2] != 'undefined') {
     3387                                                        if (typeof tokens[nrule][2] !== 'undefined') {
    20643388                                                                // Fallback: Point to last token in the rule which caused the problem.
    20653389                                                                // Run real_test regularly to fix the problem before a user is confronted with it.
     
    20743398                                        } else {
    20753399                                                pos = value.length;
    2076                                                 if (typeof tokens[nrule][0][at+1] != 'undefined') {
     3400                                                if (typeof tokens[nrule][0][at+1] !== 'undefined') {
    20773401                                                        pos -= tokens[nrule][0][at+1][2];
    2078                                                 } else if (typeof tokens[nrule][2] != 'undefined') {
     3402                                                } else if (typeof tokens[nrule][2] !== 'undefined') {
    20793403                                                        pos -= tokens[nrule][2];
    20803404                                                }
     
    20823406                                }
    20833407                                return value.substring(0, pos) + ' <--- (' + message + ')';
    2084                         } else if (typeof nrule == 'string') {
     3408                        } else if (typeof nrule === 'string') {
    20853409                                return nrule.substring(0, at) + ' <--- (' + message + ')';
    20863410                        }
     
    20943418                 */
    20953419                function formatLibraryBugMessage(message) {
    2096                         if (typeof message == 'undefined')
     3420                        if (typeof message === 'undefined')
    20973421                                message = '';
    20983422                        else
     
    21383462                                        curr_rule_tokens.push([tmp[0].toUpperCase(), 'holiday', value.length ]);
    21393463                                        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)) {
    21413465                                        /* Handle all remaining words and specific other characters with error tolerance.
    21423466                                         *
     
    21503474                                        var correct_val = returnCorrectWordOrToken(tmp[1].toLowerCase(), value.length);
    21513475                                        // console.log('Error tolerance for string "' + tmp[1] + '" returned "' + correct_val + '".');
    2152                                         if (typeof correct_val == 'object') {
     3476                                        if (typeof correct_val === 'object') {
    21533477                                                curr_rule_tokens.push([ correct_val[0], correct_val[1], value.length ]);
    21543478                                                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') {
    21573481                                                        var hours_token_at = curr_rule_tokens.length - 1;
    21583482                                                        var hours_token;
     
    21703494                                                                }
    21713495
    2172                                                                 if (typeof hours_token == 'object' && hours_token[0] <= 12) {
     3496                                                                if (typeof hours_token === 'object' && hours_token[0] <= 12) {
    21733497                                                                        hours_token[0] += 12;
    21743498                                                                        curr_rule_tokens[hours_token_at] = hours_token;
     
    21963520                                        // number
    21973521                                        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 ]);
    21993523                                                if (Number(tmp[0]) >= 2100) // Probably an error
    22003524                                                        parsing_warnings.push([ -1, value.length - 1,
     
    22233547                                                // console.log('Pos: ' + pos + ', substring: ' + tmp[pos]);
    22243548                                                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)
    22263550                                                );
    2227                                                 if (typeof correct_val != 'string' && tmp[pos] != '"') {
     3551                                                if (typeof correct_val !== 'string' && tmp[pos] !== '"') {
    22283552                                                        throw formatLibraryBugMessage(
    22293553                                                                'A character for error tolerance was allowed in the regular expression'
     
    22653589                                } else if (value.match(/^[:.]/)) {
    22663590                                        // time separator
    2267                                         if (value[0] == '.' && !done_with_warnings)
     3591                                        if (value[0] === '.' && !done_with_warnings)
    22683592                                                parsing_warnings.push([ -1, value.length - 1, 'Please use ":" as hour/minute-separator' ]);
    22693593                                        curr_rule_tokens.push([ ':', 'timesep', value.length ]);
     
    22963620                                for (var comment in word_error_correction[token_name]) {
    22973621                                        for (var old_val in word_error_correction[token_name][comment]) {
    2298                                                 if (old_val == word) {
     3622                                                if (old_val === word) {
    22993623                                                        var val = word_error_correction[token_name][comment][old_val];
    2300                                                         if (comment == 'default') {
     3624                                                        if (comment === 'default') {
    23013625                                                                // Return internal representation of word.
    23023626                                                                return [ val, token_name ];
    2303                                                         } else if (token_name == 'wrong_words' && !done_with_warnings) {
     3627                                                        } else if (token_name === 'wrong_words' && !done_with_warnings) {
    23043628                                                                // Replace wrong words or characters with correct ones.
    23053629                                                                // This will return a string which is then being tokenized.
     
    23113635                                                                var correct_abbr;
    23123636                                                                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)
    23143638                                                                                break;
    23153639                                                                }
    2316                                                                 if (typeof correct_abbr == 'undefined') {
     3640                                                                if (typeof correct_abbr === 'undefined') {
    23173641                                                                        throw formatLibraryBugMessage('Including the stacktrace.');
    23183642                                                                }
    2319                                                                 if (token_name != 'timevar') {
     3643                                                                if (token_name !== 'timevar') {
    23203644                                                                        // Everything else than timevar:
    23213645                                                                        // E.g. 'Mo' start with a upper case letter.
     
    23433667                 */
    23443668                function getWarnings(it) {
    2345                         if (!done_with_warnings && typeof it == 'object') {
     3669                        if (!done_with_warnings && typeof it === 'object') {
    23463670                                /* getWarnings was called in a state without critical errors.
    23473671                                 * We can do extended tests.
     
    23783702                                                // console.log(selector_start_end_type, new_tokens[nrule][0].length);
    23793703
    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'
    23823706                                                        ) {
    23833707                                                                has_token['24/7'] = true;
    23843708                                                }
    23853709
    2386                                                 if (typeof used_selectors[nrule][selector_start_end_type[2]] != 'object') {
     3710                                                if (typeof used_selectors[nrule][selector_start_end_type[2]] !== 'object') {
    23873711                                                        used_selectors[nrule][selector_start_end_type[2]] = [ selector_start_end_type[1] ];
    23883712                                                } else {
     
    24073731                                                                + (selector_type.match(/^(?:comment|state)/) ?
    24083732                                                                        ' ' + selector_type
    2409                                                                         + (selector_type == 'state' ? ' keywords' : 's')
     3733                                                                        + (selector_type === 'state' ? ' keywords' : 's')
    24103734                                                                        + ' in one rule.'
    24113735                                                                        + ' You may only use one in one rule.'
     
    24153739                                                                        + ' in one rule.'
    24163740                                                                        + ' 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.'
    24183742                                                                        + ' Example for time ranges "12:00-13:00,15:00-18:00".'
    24193743                                                                        + ' Example for weekdays "Mo-We,Fr".'
     
    24863810                                                        // "This rule will be evaluated as closed but it was specified as additional rule."
    24873811                                                        // + " 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."
    24893813                                                // ]);
    24903814                                        }
     
    24953819                                                var selector_type = used_selectors_types_array[nrule][i];
    24963820                                                var next_selector_type = used_selectors_types_array[nrule][i+1];
    2497                                                 if (   (   wide_range_selectors.indexOf(selector_type)       != -1
    2498                                                                 && wide_range_selectors.indexOf(next_selector_type)  != -1
    2499                                                         ) || ( small_range_selectors.indexOf(selector_type)      != -1
    2500                                                                 && 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)
    25013825                                                        ) {
    25023826
    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] === ':') {
    25043828                                                                parsing_warnings.push([nrule, used_selectors[nrule][selector_type][0],
    25053829                                                                        "You have used the optional symbol <separator_for_readability> in the wrong place."
     
    25493873                 */
    25503874                function tokenIsTheBeginOfSelector(tokens, at) {
    2551                         if (typeof tokens[at][3] == 'string') {
     3875                        if (typeof tokens[at][3] === 'string') {
    25523876                                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'
    25573881                                ){
    25583882
     
    25923916
    25933917                                // 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] === ':')
    25953919                                        selector_end++;
    25963920
     
    26223946                                get_internals   = false,
    26233947                                rule_index;
    2624                         if (typeof argument_hash != 'undefined') {
     3948                        if (typeof argument_hash !== 'undefined') {
    26253949
    26263950                                if (typeof argument_hash.conf === 'object')
     
    26353959
    26363960                        for (var key in default_prettify_conf) {
    2637                                 if (typeof user_conf[key] == 'undefined')
     3961                                if (typeof user_conf[key] === 'undefined')
    26383962                                        user_conf[key] = default_prettify_conf[key];
    26393963                        }
     
    26463970                                // Rule does contain nothing useful e.g. second rule of '10:00-12:00;' (empty) which needs to be handled.
    26473971
    2648                                 if (typeof rule_index == 'number') {
    2649                                         if (rule_index != nrule) continue;
     3972                                if (typeof rule_index === 'number') {
     3973                                        if (rule_index !== nrule) continue;
    26503974                                } else {
    26513975                                        if (nrule !== 0)
     
    26543978                                                                ? user_conf.rule_sep_string + '|| '
    26553979                                                                : (
    2656                                                                         new_tokens[nrule][0][0][1] == 'rule separator'
     3980                                                                        new_tokens[nrule][0][0][1] === 'rule separator'
    26573981                                                                        ? ','
    26583982                                                                        : (
     
    26794003                                        }
    26804004
    2681                                         if (selector_start_end_type[2] != 'rule separator') {
     4005                                        if (selector_start_end_type[2] !== 'rule separator') {
    26824006                                                prettified_group_value.push(
    26834007                                                        [
     
    27214045                                if (!done_with_selector_reordering_warnings) {
    27224046                                        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]) {
    27244048                                                        // console.log(i + ': ' + prettified_group_value[i][0][2]);
    27254049                                                        var length = i + old_prettified_value_length; // i: Number of spaces in string.
     
    28324156                                        at = parseWeekRange(tokens, at);
    28334157
    2834                                 } else if (at !== 0 && at != tokens.length - 1 && tokens[at][0] == ':') {
     4158                                } else if (at !== 0 && at !== tokens.length - 1 && tokens[at][0] === ':') {
    28354159                                        /* Ignore colon if they appear somewhere else than as time separator.
    28364160                                         * Except the start or end of the value.
    28374161                                         * This provides compatibility with the syntax proposed by Netzwolf:
    2838                                          * http://wiki.openstreetmap.org/wiki/Key:opening_hours:specification#separator_for_readability
     4162                                         * http://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#separator_for_readability
    28394163                                         * Check for valid use of <separator_for_readability> is implemented in function getWarnings().
    28404164                                         */
     
    28534177                                } else if (matchTokens(tokens, at, 'state')) {
    28544178
    2855                                         if (tokens[at][0] == 'open') {
     4179                                        if (tokens[at][0] === 'open') {
    28564180                                                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') {
    28584182                                                selectors.meaning = false;
    28594183                                        } else {
     
    28644188                                        rule_modifier_specified = true;
    28654189                                        at++;
    2866                                         if (typeof tokens[at] == 'object' && tokens[at][0] == ',') // additional rule
     4190                                        if (typeof tokens[at] === 'object' && tokens[at][0] === ',') // additional rule
    28674191                                                at = [ at + 1 ];
    28684192
     
    28784202                                        rule_modifier_specified = true;
    28794203                                        at++;
    2880                                         if (typeof tokens[at] == 'object' && tokens[at][0] == ',') // additional rule
     4204                                        if (typeof tokens[at] === 'object' && tokens[at][0] === ',') // additional rule
    28814205                                                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')) {
    28834207                                        at++;
    28844208                                        console.log("value: " + nrule);
     
    28884212                                        throw formatWarnErrorMessage(nrule, at, 'Unexpected token: "' + tokens[at][1]
    28894213                                                + '" 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 rule
     4214                                                + (warnings ? (' ' + warnings.join('; ')) : '');
     4215                                }
     4216
     4217                                if (typeof at === 'object') { // additional rule
    28944218                                        tokens[at[0] - 1][1] = 'rule separator';
    28954219                                        break;
     
    29024226                function get_last_token_pos_in_token_group(tokens, at, last_at) {
    29034227                        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'){
    29084232
    29094233                                                        return at - 1;
     
    30204344                                                'Number between -5 and 5 (except 0) expected');
    30214345
    3022                                 if (from == to) {
     4346                                if (from === to) {
    30234347                                        if (number !== 0)
    30244348                                                throw formatWarnErrorMessage(nrule, at,
     
    30474371                                        'You can not use '+ period_type +' ranges with period equals zero.');
    30484372                        } 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')
    30504374                                        parsing_warnings.push([nrule, at,
    30514375                                                'Please don’t use '+ period_type +' ranges with period equals one.'
     
    30724396                        tmp_date.setDate(tmp_date.getDate() + (constrained_weekday[0] + (constrained_weekday[0] > 0 ? -1 : 0)) * 7);
    30734397
    3074                         if (typeof add_days != 'undefined' && add_days[1])
     4398                        if (typeof add_days !== 'undefined' && add_days[1])
    30754399                                tmp_date.setDate(tmp_date.getDate() + add_days[0]);
    30764400
     
    30884412                        // May use this instead. The problem is that this does not give feedback as precise as the code which is used in this function.
    30894413                        // 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) {
    30914415                        //      console.error('date not valid');
    30924416                        // }
     
    30954419                        if (day < 1 || day > 31)
    30964420                                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)
    30984422                                throw formatWarnErrorMessage(nrule, at, 'Month ' + months[month] + " doesn't have 31 days.!");
    3099                         if (month == 1 && day == 30)
     4423                        if (month === 1 && day === 30)
    31004424                                throw formatWarnErrorMessage(nrule, at, 'Month ' + months[1]+ " either has 28 or 29 days (leap years).");
    31014425                }
     
    31194443                        for (; at < tokens.length; at++) {
    31204444                                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');
    31224446                                        has_time_var_calc[0] = matchTokens(tokens, at, '(', 'timevar');
    31234447                                var minutes_from,
     
    31544478                                                                        at+(
    31554479                                                                                has_normal_time[0] ? (
    3156                                                                                         typeof tokens[at+3] == 'object' ? 3 : 2
     4480                                                                                        typeof tokens[at+3] === 'object' ? 3 : 2
    31574481                                                                                ) : (
    31584482                                                                                        has_time_var_calc[0] ? 2 : (
    3159                                                                                                         typeof tokens[at+1] != 'undefined' ? 1 : 0
     4483                                                                                                        typeof tokens[at+1] !== 'undefined' ? 1 : 0
    31604484                                                                                                )
    31614485                                                                                )
     
    31864510                                                has_time_var_calc[1]      = matchTokens(tokens, at_end_time, '(', 'timevar');
    31874511                                                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),
    31894513                                                                        'Time range does not continue as expected');
    31904514                                                } else {
     
    32284552                                                parseTimeRange(tokens, at_end_time, selectors, minutes_to < minutes_from ? 1 : true);
    32294553                                                at++;
    3230                                         } else if (oh_mode == 1 && !is_point_in_time) {
     4554                                        } else if (oh_mode === 1 && !is_point_in_time) {
    32314555                                                throw formatWarnErrorMessage(nrule, at_end_time,
    32324556                                                        'opening_hours is running in "points in time mode". Found time range.');
    32334557                                        }
    32344558
    3235                                         if (typeof lat != 'undefined') { // lon will also be defined (see above)
     4559                                        if (typeof lat !== 'undefined') { // lon will also be defined (see above)
    32364560                                                if (!has_normal_time[0] || !(has_normal_time[1] || has_open_end || is_point_in_time) )
    32374561                                                        week_stable = false;
     
    32444568                                                throw formatWarnErrorMessage(nrule, at_end_time - 2,
    32454569                                                        '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))
    32474571                                                minutes_to += minutes_in_day;
    32484572                                        if (minutes_to > minutes_in_day * 2)
     
    32514575
    32524576                                        // 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) {
    32544578                                                selectors.time.push(function(date) { return [true]; });
    32554579                                        } else {
     
    32694593                                                                        // normal times: if (minutes_to < minutes_from)
    32704594                                                                        // 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') {
    32724596                                                                        minutes_to = minutes_from + 1;
    32734597                                                                }
    32744598
    3275                                                                 if (typeof point_in_time_period == 'number') {
     4599                                                                if (typeof point_in_time_period === 'number') {
    32764600                                                                        if (ourminutes < minutes_from) {
    32774601                                                                                return [false, dateAtDayMinutes(date, minutes_from)];
    32784602                                                                        } else if (ourminutes <= minutes_to) {
    32794603                                                                                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) {
    32814605                                                                                                return [true, dateAtDayMinutes(date, ourminutes + 1)];
    32824606                                                                                        } else if (ourminutes < cur_min) {
     
    33114635                                                                }
    33124636
    3313                                                                 if (typeof point_in_time_period == 'number') {
     4637                                                                if (typeof point_in_time_period === 'number') {
    33144638                                                                        if (ourminutes <= minutes_to) {
    33154639                                                                                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) {
    33174641                                                                                                return [true, dateAtDayMinutes(date, ourminutes + 1)];
    33184642                                                                                        } else if (ourminutes < cur_min) {
     
    33384662                                                                        var date_to = SunCalc.getTimes(date, lat, lon)[timevar_string[1]];
    33394663                                                                        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') {
    33414665                                                                        minutes_to = minutes_from + 1;
    33424666                                                                }
    33434667
    3344                                                                 if (typeof point_in_time_period == 'number') {
     4668                                                                if (typeof point_in_time_period === 'number') {
    33454669                                                                        if (ourminutes < minutes_from) {
    33464670                                                                                return [false, dateAtDayMinutes(date, minutes_from)];
    33474671                                                                        } else if (ourminutes <= minutes_to) {
    33484672                                                                                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) {
    33504674                                                                                                return [true, dateAtDayMinutes(date, ourminutes + 1)];
    33514675                                                                                        } else if (ourminutes < cur_min) {
     
    34244748                                                throw formatWarnErrorMessage(nrule, at+1, 'Missing minutes in time range after: "' + tokens[at+1][1] + '"');
    34254749                                        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),
    34274751                                                                'Missing time separator in time range after: "' + tokens[at][1] + '"');
    34284752                                        return [ at ];
     
    34684792                                if (matchTokens(tokens, at+3, 'number', 'timesep', 'number')) {
    34694793                                        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';
    34714795                                                var minutes = getMinutesByHoursMinutes(tokens, nrule, at+3) * add_or_subtract;
    34724796                                                if (minutes === 0)
     
    35184842                                                                'Number between -5 and 5 (except 0) expected');
    35194843
    3520                                                 if (from == to) {
     4844                                                if (from === to) {
    35214845                                                        numbers.push(from);
    35224846                                                } else if (from < to) {
     
    35874911                                                                        + (number + (number > 0 ? -1 : 0)) * 7 + add_days);
    35884912
    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))
    35904914                                                                        return [true, dateAtDayMinutes(date, minutes_in_day)];
    35914915                                                        } else if (add_days < 0) {
     
    36004924                                                                } else {
    36014925                                                                        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)
    36034927                                                                                return [true, dateAtDayMinutes(date, minutes_in_day)];
    36044928
     
    36084932
    36094933                                                        // 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()) {
    36114935                                                                return [true, dateAtDayMinutes(date, minutes_in_day)];
    36124936                                                        }
     
    36604984                                        week_stable = false;
    36614985                                        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');
    36624992                                } else {
    36634993                                        throw formatWarnErrorMessage(nrule, at, 'Unexpected token in weekday range: ' + tokens[at][1]);
     
    37195049                        for (; at < tokens.length; at++) {
    37205050                                if (matchTokens(tokens, at, 'holiday')) {
    3721                                         if (tokens[at][0] == 'PH') {
     5051                                        if (tokens[at][0] === 'PH') {
    37225052                                                var applying_holidays = getMatchingHoliday(tokens[at][0]);
    37235053
     
    37465076                                                                                if (date_num < last_holiday_last_year_num ) {
    37475077                                                                                        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) {
    37495079                                                                                        return [true, dateAtDayMinutes(last_holiday_last_year[0], minutes_in_day),
    37505080                                                                                                'Day after ' +last_holiday_last_year[1] ];
     
    37535083
    37545084                                                                        return [ false, holidays[i][0] ];
    3755                                                                 } else if (date_num == next_holiday_date_num) {
     5085                                                                } else if (date_num === next_holiday_date_num) {
    37565086                                                                        return [true, new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1),
    37575087                                                                                (add_days[0] > 0 ? 'Day after ' : (add_days[0] < 0 ? 'Day before ' : '')) + holidays[i][1] ];
     
    37645094                                                                var first_holidays_next_year = holidays_next_year[0];
    37655095                                                                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) {
    37675097                                                                        return [true, dateAtDayMinutes(first_holidays_next_year[0], minutes_in_day),
    37685098                                                                                'Day before ' + first_holidays_next_year[1] ];
     
    37835113
    37845114                                                at += 1 + add_days[1];
    3785                                         } else if (tokens[at][0] == 'SH') {
     5115                                        } else if (tokens[at][0] === 'SH') {
    37865116                                                var applying_holidays = getMatchingHoliday(tokens[at][0]);
    37875117
     
    38085138                                                                                // check if we are in the holidays from the last year spanning into this year
    38095139                                                                                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') {
    38115141                                                                                        var last_year_holiday_from = (last_year_holiday[last_year_holiday.length - 4] - 1) * 100
    38125142                                                                                                + last_year_holiday[last_year_holiday.length - 3]; // e.g. 1125
     
    38275157                                                                                return [ true, new Date(date.getFullYear() + holiday_ends_next_year, holiday[2+h] - 1, holiday[3+h] + 1),
    38285158                                                                                        applying_holidays[i].name ];
    3829                                                                         } else if (holiday_to_plus == date_num) { // selected holiday end is equal to month and day
     5159                                                                        } else if (holiday_to_plus === date_num) { // selected holiday end is equal to month and day
    38305160                                                                                if (h + 4 < holiday.length) { // next holiday is next date range of the same holidays
    38315161                                                                                        h += 4;
    38325162                                                                                        return [ false, new Date(date.getFullYear(), holiday[0+h] - 1, holiday[1+h]) ];
    38335163                                                                                } else {
    3834                                                                                         if (i + 1 == applying_holidays.length) { // last holidays are handled, continue all over again
     5164                                                                                        if (i + 1 === applying_holidays.length) { // last holidays are handled, continue all over again
    38355165                                                                                                var holiday = getSHForYear(applying_holidays[0], date.getFullYear() + 1);
    38365166                                                                                                return [ false, new Date(date.getFullYear() + !holiday_ends_next_year, holiday[0+h] - 1, holiday[1+h]) ];
     
    38505180                                                else
    38515181                                                        selectors.holiday.push(selector);
    3852                                                 at += 1;
     5182                                                at += 1; // FIXME: test
    38535183                                        }
    38545184                                } else if (matchTokens(tokens, at, 'weekday')) {
    38555185                                        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');
    38565192                                } else {
    3857                                         throw formatWarnErrorMessage(nrule, at, 'Unexpected token (school holiday parser): ' + tokens[at][1]);
     5193                                        throw formatWarnErrorMessage(nrule, at, 'Unexpected token (holiday parser): ' + tokens[at][1]);
    38585194                                }
    38595195
     
    38775213                function getValueForDate(date, include_year) {
    38785214                        // 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;
    38805216
    38815217                        return (include_year ? date.getFullYear() * 10000 : 0) + date.getMonth() * 100 + date.getDate();
     
    38865222                // for the specified year
    38875223                function getSHForYear(SH_hash, year, fatal) {
    3888                         if (typeof fatal == 'undefined')
     5224                        if (typeof fatal === 'undefined')
    38895225                                fatal = true;
    38905226
    38915227                        var holiday = SH_hash[year];
    3892                         if (typeof holiday == 'undefined') {
     5228                        if (typeof holiday === 'undefined') {
    38935229                                holiday = SH_hash['default']; // applies for any year without explicit definition
    3894                                 if (typeof holiday == 'undefined') {
     5230                                if (typeof holiday === 'undefined') {
    38955231                                        if (fatal) {
    38965232                                                throw formatLibraryBugMessage('School holiday ' + SH_hash.name + ' has no definition for the year ' + year + '.'
     
    39085244                // (which can be limited to some states).
    39095245                function getMatchingHoliday(type_of_holidays) {
    3910                         if (typeof location_cc != 'undefined') {
     5246                        if (typeof location_cc !== 'undefined') {
    39115247                                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))
    39265260                                                                        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];
    39285263                                                        }
    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_cc
    3935                                                                         + ' and state ' + location_state + '.'
    3936                                                                         + ' You can also add them: ' + repository_url);
    39375264                                                }
     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);
    39385273                                        }
    39395274                                } else {
     
    39415276                                                        + ' You can also add them: ' + repository_url);
    39425277                                }
    3943                         } else { // we have no idea which holidays do apply because the country code was not provided
     5278                        } else { /* We have no idea which holidays do apply because the country code was not provided. */
    39445279                                throw 'Country code missing which is needed to select the correct holidays (see README how to provide it)';
    39455280                        }
     
    39915326                        var canadaDay = july_1.getDay() === 0 ? 2 : 1;
    39925327
    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);
    39995331                        }
    40005332
     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
    40015339                        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)),
    40115366                        };
    40125367                }
     
    40195374
    40205375                        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') {
    40225377                                        var selected_movableDay = movableDays[applying_holidays[holiday_name][0]];
    40235378                                        if (!selected_movableDay)
     
    40295384                                                        + applying_holidays[holiday_name][1]
    40305385                                                );
    4031                                         if (year != next_holiday.getFullYear())
     5386                                        if (year !== next_holiday.getFullYear())
    40325387                                                throw 'The movable day ' + applying_holidays[holiday_name][0] + ' plus '
    40335388                                                        + applying_holidays[holiday_name][1]
     
    40895444                                        // error checking {{{
    40905445                                                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                                                        }
    41005456                                                }
    41015457                                        // }}}
     
    41225478                                                        if (ouryear <= year_to)
    41235479                                                                return [true, new Date(year_to + 1, 0, 1)];
    4124                                                 } else if (ouryear == year_from) {
     5480                                                } else if (ouryear === year_from) {
    41255481                                                        return [true];
    41265482                                                }
     
    41305486                                        }}(tokens, at, year_from, is_range, has_period, period));
    41315487
    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');
    41335495                                } else {
    41345496                                        throw formatWarnErrorMessage(nrule, at, 'Unexpected token in year range: ' + tokens[at][1]);
     
    41915553                                        }
    41925554
    4193                                         if (!period && week_from == 1 && week_to == 53) {
     5555                                        if (!period && week_from === 1 && week_to === 53) {
    41945556                                                /* Shortcut and work around bug. */
    41955557                                                selectors.week.push(function(date) { return [true]; });
     
    42255587
    42265588                                                        // 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)];
    42285590                                                }}(week_from, week_to, is_range, period));
    42295591                                        }
    42305592
    42315593                                        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');
    42325600                                } else {
    42335601                                        throw formatWarnErrorMessage(nrule, at, 'Unexpected token in week range: ' + tokens[at][1]);
     
    43935761                                        has_constrained_weekday[0] = getConstrainedWeekday(tokens, at+has_year[0]+3);
    43945762                                        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);
    43965764                                } else {
    43975765                                        at_range_sep = at+has_year[0]
    43985766                                                + (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)
    44005768                                                        : 2);
    44015769                                }
     
    44185786
    44195787                                // 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])) {
    44215789
    44225790                                        if (has_month[0])
     
    44345802                                                        from_date = movableDays[tokens[at+has_year[0]][0]];
    44355803
    4436                                                         if (typeof has_calc[0] != 'undefined' && has_calc[0][1]) {
     5804                                                        if (typeof has_calc[0] !== 'undefined' && has_calc[0][1]) {
    44375805                                                                var from_year_before_calc = from_date.getFullYear();
    44385806                                                                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())
    44405808                                                                        throw formatWarnErrorMessage(nrule, at+has_year[0]+has_calc[0][1]*3,
    44415809                                                                                'The movable day ' + tokens[at+has_year[0]][0] + ' plus ' + has_calc[0][0]
     
    44605828                                                        to_date = movableDays[tokens[at_sec_event_or_month][0]];
    44615829
    4462                                                         if (typeof has_calc[1] != 'undefined' && has_calc[1][1]) {
     5830                                                        if (typeof has_calc[1] !== 'undefined' && has_calc[1][1]) {
    44635831                                                                var to_year_before_calc = to_date.getFullYear();
    44645832                                                                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())
    44665834                                                                        throw formatWarnErrorMessage(nrule, at_sec_event_or_month+has_calc[1][1],
    44675835                                                                                'The movable day ' + tokens[at_sec_event_or_month][0] + ' plus ' + has_calc[1][0]
     
    45095877                                                        ? has_constrained_weekday[1][1]
    45105878                                                        : 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);
    45125880
    45135881                                        // }}}
     
    45605928                                                        var from_date = new Date(has_year ? year : date.getFullYear(),
    45615929                                                                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.
    45635931                                                                return [false]; // If day 29 does not exist,
    45645932                                                                                                // then the date object adds one day to date
     
    45665934                                                        var to_date   = new Date(from_date.getFullYear(),
    45675935                                                                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.
    45695937                                                                return [false];
    45705938
     
    46135981                                                if (add_days[0]) {
    46145982                                                        event_date.setDate(event_date.getDate() + add_days[0]);
    4615                                                         if (date.getFullYear() != event_date.getFullYear())
     5983                                                        if (date.getFullYear() !== event_date.getFullYear())
    46165984                                                                throw formatWarnErrorMessage(nrule, at+has_year+add_days[1], 'The movable day ' + tokens[at+has_year][0] + ' plus '
    46175985                                                                        + add_days[0]
     
    46225990                                                        return [false, event_date];
    46235991                                                // 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())
    46255993                                                        return [true, new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1)];
    46265994                                                else
     
    46346002                                                selectors.monthday.push(selector);
    46356003
    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);
    46376005                                        // }}}
    46386006                                } else if (has_constrained_weekday[0]) {
     
    46736041                        var date_matching_rules = [];
    46746042
     6043                        /* Go though all date selectors and check if they return something
     6044                         * else than closed for the given date.
     6045                         */
    46756046                        for (var nrule = 0; nrule < rules.length; nrule++) {
    46766047                                var matching_date_rule = true;
    46776048                                // console.log(nrule, 'length',  rules[nrule].date.length);
    46786049
    4679                                 // Try each date selector type
     6050                                /* Try each date selector type. */
    46806051                                for (var ndateselector = 0; ndateselector < rules[nrule].date.length; ndateselector++) {
    46816052                                        var dateselectors = rules[nrule].date[ndateselector];
     
    46886059                                                        has_matching_selector = true;
    46896060
    4690                                                         if (typeof res[2] == 'string') { // holiday name
    4691                                                                 comment = [ res[2] ];
     6061                                                        if (typeof res[2] === 'string') { // holiday name
     6062                                                                comment = [ res[2], nrule ];
    46926063                                                        }
    46936064
     
    47066077                                                break;
    47076078                                        }
    4708 
    47096079                                }
    47106080
    47116081                                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                                         */
    47176088                                        if ((rules[nrule].date.length > 0 || nrule > 0 && rules[nrule].meaning && rules[nrule-1].date.length === 0)
    47186089                                                        && (rules[nrule].meaning || rules[nrule].unknown)
     
    47316102                        }
    47326103
     6104                        // console.log(date_matching_rules);
    47336105                        rule:
    47346106                        for (var nrule = 0; nrule < date_matching_rules.length; nrule++) {
     
    47386110                                        // + ' and ' + rules[rule].time.length + ' time selectors (comment: "' + rules[rule].comment + '").');
    47396111
    4740                                 // there is no time specified, state applies to the whole day
     6112                                /* There is no time specified, state applies to the whole day. */
    47416113                                if (rules[rule].time.length === 0) {
    47426114                                        // console.log('there is no time', date);
     
    47446116                                                resultstate = rules[rule].meaning;
    47456117                                                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;
    47526119
    47536120                                                // if (rules[rule].fallback)
     
    47676134                                                        match_rule  = rule;
    47686135
    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;
    47756139
    47766140                                                        // open end
    47776141                                                        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 ];
    47806143
    47816144                                                                resultstate = false;
     
    47836146
    47846147                                                                /* 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') {
    47866149
    47876150                                                                        var next_res = rules[rule].time[timesel+1](date);
    47886151                                                                        if (  !next_res[0]
    47896152                                                                                // && 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.
    47926155                                                                                && rules[rule].time[timesel](new Date(date.getTime() - 1))[0]
    4793                                                                                 /* To keep the following two apart:
     6156                                                                                /* To distinguish the following two values:
    47946157                                                                                 *       'sunrise-14:00,14:00+',
    47956158                                                                                 *   '07:00+,12:00-16:00',
     
    48136176                                                                 */
    48146177                                                                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()
    48196182                                                                                ) {
    48206183
     
    48246187
    48256188                                                                        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()
    48306193                                                                                ) {
    48316194
     
    48546217                                        if (typeof changedate === 'undefined' || (typeof res[1] !== 'undefined' && res[1] < changedate))
    48556218                                                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;
    48566230                                }
    48576231                        }
     
    48806254                                                && at - selector_start > 1 && (matchTokens(tokens, at-1, ',') || matchTokens(tokens, at-1, '-'))
    48816255                                                && 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) {
    48836257                                                        value = value.substring(0, value.length - 1) + conf.sep_one_day_between;
    48846258                                        }
    48856259                                        value += weekdays[tokens[at][0]];
    48866260                                } else if (at - selector_start > 0 // e.g. '09:0' -> '09:00'
    4887                                                 && selector_type == 'time'
     6261                                                && selector_type === 'time'
    48886262                                                && matchTokens(tokens, at-1, 'timesep')
    48896263                                                && matchTokens(tokens, at, 'number')) {
    48906264                                        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'
    48926266                                                && conf.zero_pad_hour
    4893                                                 && at != tokens.length
     6267                                                && at !== tokens.length
    48946268                                                && matchTokens(tokens, at, 'number')
    48956269                                                && matchTokens(tokens, at+1, 'timesep')) {
     
    48996273                                                                 '' : '0') :
    49006274                                                                '') + 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'
    49026276                                                && at + 2 <= selector_end
    49036277                                                && matchTokens(tokens, at, 'number')
     
    49166290                                        value += (conf.leave_off_closed ? tokens[at][0] : conf.keyword_for_off_closed);
    49176291                                } 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'
    49206294                                                )) {
    49216295                                        value += ' '
     
    49356309                                                && (matchTokens(tokens, at, '-') || matchTokens(tokens, at, '+'))
    49366310                                                && 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');
    49386312                                        at += 2;
    4939                                 } else if (at == selector_end
    4940                                                 && selector_type == 'weekday'
    4941                                                 && tokens[at][0] == ':') {
     6313                                } else if (at === selector_end
     6314                                                && selector_type === 'weekday'
     6315                                                && tokens[at][0] === ':') {
    49426316                                        // Do nothing.
    49436317                                } else {
     
    49726346                                /* setDate {{{ */
    49736347                                this.setDate = function(date) {
    4974                                         if (typeof date != 'object')
     6348                                        if (typeof date !== 'object')
    49756349                                                throw 'Date parameter needed.';
    49766350
     
    50066380                                /* getMatchingRule: Get the rule which matched thus deterrents the current state {{{ */
    50076381                                this.getMatchingRule = function() {
    5008                                         if (typeof state[4] == 'undefined')
     6382                                        if (typeof state[4] === 'undefined')
    50096383                                                return undefined;
    50106384
     
    51306504                        while (it.advance(to)) {
    51316505                                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') {
    51336507                                                // last state was also open or unknown
    51346508                                                res[res.length - 1][1] = it.getDate();
     
    51366510                                        res.push([it.getDate(), undefined, it.getUnknown(), it.getComment()]);
    51376511                                } 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') {
    51396513                                                // only use the first time as closing/change time and ignore closing times which might follow
    51406514                                                res[res.length - 1][1] = it.getDate();
Note: See TracChangeset for help on using the changeset viewer.