opening_hours 3.8.0 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  <!--
2
- SPDX-FileCopyrightText: 2012-2013 Dmitry Marakasov
3
- SPDX-FileCopyrightText: 2013-2021 Robin Schneider <ypid@riseup.net>
2
+ SPDX-FileCopyrightText: © 2012 Dmitry Marakasov
3
+ SPDX-FileCopyrightText: © 2013 Robin Schneider <ypid@riseup.net>
4
4
 
5
5
  SPDX-License-Identifier: LGPL-3.0-only
6
6
 
7
7
  This file is based on work under the following copyright and permission
8
8
  notice:
9
9
 
10
- Copyright (c) 2012-2013 Dmitry Marakasov
10
+ Copyright (c) 2012 Dmitry Marakasov
11
11
  All rights reserved.
12
12
 
13
13
  Redistribution and use in source and binary forms, with or without
@@ -177,7 +177,7 @@ yarn add opening_hours
177
177
 
178
178
  The version number consists of a major release, minor release and patch level (separated by a dot).
179
179
 
180
- For version 2.2.0 and all later, [Semantic Versioning](http://semver.org/spec/v2.0.0.html) is used:
180
+ For version 2.2.0 and all later, [Semantic Versioning](https://semver.org/spec/v2.0.0.html) is used:
181
181
 
182
182
  - The major release is only increased if the release breaks backward compatibility.
183
183
  - The minor release is increased if new features are added.
@@ -531,9 +531,9 @@ Almost everything from opening_hours definition is supported, as well as some ex
531
531
 
532
532
  - Supports 24/7 keyword (`24/7`, which means always open. Use [state keywords][ohlib.states] to express always closed.)
533
533
 
534
- - **WARN:** 24/7 is handled as a synonym for `00:00-24:00`, so `Mo-Fr 24/7` (though not really correct, because of that you should avoid it or replace it with "open". A warning will be given if you use it anyway for that purpose) will be handled correctly
534
+ - **WARN:** 24/7 is handled as a synonym for `00:00-24:00`, so it can be misused like `Mo-Fr 24/7` and still interpreted (but it is not really correct, you should avoid it or replace it with "open". A warning will be given if you use it anyway for that purpose)
535
535
 
536
- *The use of 24/7 as synonym is never needed and should be avoided in cases where it does not mean 24/7.* In cases where a facility is really open 24 hours 7 days a week thats where this value is for.
536
+ *The use of 24/7 in such way is never needed, you should use `24/7` only when it applies to the entire week.* In cases where a facility is really open 24 hours 7 days a week thats where this value is for.
537
537
 
538
538
  - **WARN:** Supports omitting time range (`Mo-Fr; Tu off`)
539
539
 
@@ -577,31 +577,42 @@ Almost everything from opening_hours definition is supported, as well as some ex
577
577
 
578
578
  - Countries with PH definition:
579
579
 
580
+ - [Argentina][ph-ar]
580
581
  - [Australia][ph-au]
581
582
  - [Austria][ph-at] ([footnotes][ph-at] are ignored)
582
583
  - [Belgium][ph-be] (See [issue #115](https://github.com/opening-hours/opening_hours.js/issues/115) for details)
583
584
  - [Brazil][ph-br]
584
585
  - [Canada][ph-ca]
586
+ - China (Only fixed-date holidays. See https://github.com/opening-hours/opening_hours.js/issues/408)
587
+ - [Croatia][ph-hr]
585
588
  - [Czech Republic][ph-cz]
586
589
  - [Denmark][ph-dk]
587
590
  - [England and Wales][ph-gb]
588
591
  - [France][ph-fr]
592
+ - Finland
589
593
  - [Germany][ph-de] ([footnotes][ph-de] are ignored)
594
+ - Greece
590
595
  - [Hungary][ph-hu]
591
596
  - [Ireland][ph-ie]
592
597
  - [Italy][ph-it] (Without the Saint Patron day, see [comment](https://github.com/opening-hours/opening_hours.js/pull/74#issuecomment-76194891))
593
598
  - [Ivory Coast][ph-ci] (Without the four islamic holidays because they can not be calculated and depend on subjective ad-hoc definition)
599
+ - Japan
600
+ - Luxembourg
601
+ - Namibia
594
602
  - [Netherlands][ph-ne]
595
603
  - [New Zealand][ph-nz] (Provincial holiday is not handled. See [PR #333](https://github.com/opening-hours/opening_hours.js/pull/333) for details.)
604
+ - Norway
596
605
  - [Poland][ph-nl]
597
606
  - [Romania][ph-ro]
598
607
  - [Russian][ph-ru]
599
- - [Slovenian][ph-si]
608
+ - Slovakia
609
+ - [Slovenia][ph-si]
610
+ - Spain
600
611
  - [Sweden][ph-se]
601
612
  - [Switzerland][ph-ch]
602
613
  - [Ukraine][ph-ua]
603
614
  - [United states][ph-us] (Some special cases are [currently not handled](https://github.com/opening-hours/opening_hours.js/issues/69#issuecomment-74103181))
604
- - [Vietnam][ph-vn] (Some public holidays cannot currently be calulated by the library and are missing. See https://github.com/opening-hours/opening_hours.js/pull/388)
615
+ - [Vietnam][ph-vn] (Lunar calendar-based public holidays cannot currently be calculated by the library and are missing. See https://github.com/opening-hours/opening_hours.js/pull/388)
605
616
 
606
617
  - **EXT:** Supports limited calculations based on public holidays (e.g. `Sa,PH -1 day open`). The only two possibilities are currently +1 and -1. All other cases are not handled. This seems to be enough because the only thing which is really used is -1.
607
618
 
@@ -609,10 +620,15 @@ Almost everything from opening_hours definition is supported, as well as some ex
609
620
 
610
621
  - Countries with SH definition:
611
622
 
612
- - Germany, see [hc]
613
- - Austria
614
- - Romania
615
- - Hungary
623
+ - Austria (national until 2024, regional until 2021)
624
+ - Belgium (good until 2026)
625
+ - Croatia (good until 2022&ndash;2023)
626
+ - France (good until 2025)
627
+ - Germany, see [hc] (good until 2025)
628
+ - Greece (good until 2020)
629
+ - Hungary (good until 2024&ndash;2025)
630
+ - Luxembourg (good until 2025&ndash;2026)
631
+ - Romania (good until 2021)
616
632
 
617
633
  - There can be two cases which need to be separated (this applies for PH and SH):
618
634
 
@@ -688,7 +704,7 @@ A node.js based test framework is bundled. You can run it with `node test/test.j
688
704
 
689
705
  Included in the `test` directory are the log outputs of the previous testing runs. By comparing to these logs and assuming that the checkedd-in logs are always passing, it allows the developer to validate if the number of passed tests have changed since the last feature implementation.
690
706
 
691
- The current results of this test are also tracked in the repository and can be viewed [here](/test.en.log). Note that this file uses [ANSI escape code](https://en.wikipedia.org/wiki/ANSI_escape_code) which can be interpreted by cat in the terminal. `make check` compares the test output with the output from the last commit and shows you a diff.
707
+ The current results of this test are also tracked in the repository and can be viewed [here](test/test.en.log). Note that this file uses [ANSI escape code](https://en.wikipedia.org/wiki/ANSI_escape_code) which can be interpreted by cat in the terminal. `make check` compares the test output with the output from the last commit and shows you a diff.
692
708
 
693
709
  ### Testing with real data
694
710
 
@@ -720,7 +736,7 @@ Testing is much easier by now. Have a look at the [evaluation tool][ohlib.evalua
720
736
 
721
737
  ## Performance
722
738
 
723
- Simple node.js based benchmark is bundled. You can run it with `node ./scripts/benchmark.js` or with `make benchmark`.
739
+ Simple node.js based benchmark is bundled. You can run it with `node ./scripts/benchmark.mjs` or with `make benchmark`.
724
740
 
725
741
  The library allows ~9k/sec constructor calls and ~9k/sec openIntervals() calls with one week period on author's Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz running NodeJS 7.7.1, Linux 4.4.38-11 virtualized under Xen/Qubes OS). This may further improve in the future.
726
742
 
@@ -737,7 +753,7 @@ This library is known to the used by the following projects:
737
753
  | [YoHours][] | A simple editor for OpenStreetMap opening hours, [GitHub](https://github.com/PanierAvide/panieravide.github.io/tree/master/yohours) |
738
754
  | [opening_hours_server.js] | A little server answering query‘s for opening_hours and check if they can be evaluated. |
739
755
  | [opening_hours-statistics] | Visualization of the data quality and growth over time in OSM. |
740
- | [www.openstreetmap.hu](http://www.openstreetmap.hu/) | old version of this library, see also <https://github.com/AMDmi3/opening_hours.js/issues/19> |
756
+ | [www.openstreetmap.hu](https://www.openstreetmap.hu/) | old version of this library, see also <https://github.com/AMDmi3/opening_hours.js/issues/19> |
741
757
  | [osmopeninghours][] | JavaScript library which provides a more abstract, specialized API and Italian localization. It returns a JavaScript object for a given time interval (see [example.json](https://github.com/digitalxmobile-dev/osmopeninghours/blob/master/example/example.json)). |
742
758
  | [ComplexAlarm](https://github.com/ypid/ComplexAlarm) | Java/Android. Using the JS implementation through [js-evaluator-for-android](https://github.com/evgenyneu/js-evaluator-for-android). |
743
759
  | [MapComplete](https://github.com/pietervdvn/MapComplete) | An OpenStreetMap-editor which aims to be really simple to use by offering multiple themes |
@@ -758,7 +774,7 @@ YoHours currently only checks with this lib if the opening_hours value can be ev
758
774
  [pyopening_hours]: https://github.com/ypid/pyopening_hours
759
775
  [opening_hours_server.js]: https://github.com/ypid/opening_hours_server.js
760
776
  [opening_hours-statistics]: https://github.com/ypid/opening_hours-statistics
761
- [yohours]: http://github.pavie.info/yohours/
777
+ [yohours]: https://projets.pavie.info/yohours/
762
778
  [osmopeninghours]: https://github.com/digitalxmobile-dev/osmopeninghours
763
779
 
764
780
  ## Bindings and ports
@@ -842,7 +858,7 @@ Note that there is a git pre-commit hook used to run and compare the test framew
842
858
 
843
859
  #### Documentation
844
860
 
845
- All functions are documented, which should help contributers to get started.
861
+ All functions are documented, which should help contributors to get started.
846
862
 
847
863
  The documentation looks like this:
848
864
 
@@ -859,14 +875,13 @@ The documentation looks like this:
859
875
  function getConstrainedWeekday(tokens, at) {}
860
876
  ```
861
877
 
862
- The opening brackets `{{{` (and the corresponding closing onces) are used to fold the source code. See [Vim folds](http://vim.wikia.com/wiki/Folding).
878
+ The opening brackets `{{{` (and the corresponding closing onces) are used to fold the source code. See [Vim folds](https://vim.fandom.com/wiki/Folding).
863
879
 
864
- ## Authors
880
+ ## Maintainers
865
881
 
866
- | Autor | Contact | Note |
867
- | --------------------------------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
868
- | [Dmitry Marakasov](https://github.com/AMDmi3) | <amdmi3@amdmi3.ru> | Initial coding and design and all basic features like time ranges, week ranges, month ranges and week ranges. |
869
- | [Robin Schneider](https://me.ypid.de/) | <ypid@riseup.net> | Maintainer (since September 2013). Added support for years, holidays, unknown, comments, open end, fallback/additional rules (and more), wrote getWarnings, prettifyValue, translated demo page to English and German and extended it to enter values yourself (now called [evaluation tool][ohlib.evaluation-tool]). |
882
+ * [Dmitry Marakasov](https://github.com/AMDmi3) <amdmi3@amdmi3.ru>: Maintainer from 2012-12 until 2014-05. Initial coding and design and all basic features like time ranges, week ranges, month ranges and week ranges.
883
+ * [Robin Schneider](https://me.ypid.de/) <ypid@riseup.net>: Maintainer from 2013-09 until 2025-05. Added support for years, holidays, unknown, comments, open end, fallback/additional rules (and more), wrote getWarnings, prettifyValue, translated demo page to English and German and extended it to enter values yourself (now called [evaluation tool][ohlib.evaluation-tool]).
884
+ * [Kristjan ESPERANTO](https://github.com/KristjanESPERANTO) [GitHub](https://github.com/KristjanESPERANTO)/[OSM](https://www.openstreetmap.org/user/Kristjan%20ESPERANTO): Maintainer since 2025-05. Switch from CommonJS to ESM. Sharpening the ESLint rules incl. handling the reported issues. HTML/CSS/JS/GitHub CI improvements, keeping the stack up-to-date.
870
885
 
871
886
  ## Contributors
872
887
 
@@ -874,7 +889,7 @@ Refer to the [Changelog](https://github.com/opening-hours/opening_hours.js/blob/
874
889
 
875
890
  ## Credits
876
891
 
877
- - [Netzwolf](http://www.netzwolf.info/) (He developed the first and very feature complete JS implementation for opening_hours (time_domain.js, [mirror](https://openingh.ypid.de/netzwolf_mirror/)). His implementation did not create selector code to go through time as this library does (which is a more advanced design). time_domain.js has been withdrawn in favor of opening_hours.js but a few parts where reused (mainly the error tolerance and the online evaluation for the [evaluation tool][ohlib.evaluation-tool]). It was also very useful as prove and motivation that all those complex things used in the [opening_hours syntax][oh:specification] are possible to evaluate with software :) )
892
+ - [Netzwolf](https://www.netzwolf.info/) (He developed the first and very feature complete JS implementation for opening_hours (time_domain.js, [mirror](https://openingh.ypid.de/netzwolf_mirror/)). His implementation did not create selector code to go through time as this library does (which is a more advanced design). time_domain.js has been withdrawn in favor of opening_hours.js but a few parts where reused (mainly the error tolerance and the online evaluation for the [evaluation tool][ohlib.evaluation-tool]). It was also very useful as prove and motivation that all those complex things used in the [opening_hours syntax][oh:specification] are possible to evaluate with software :) )
878
893
  - Also thanks to FOSSGIS for hosting a public instance of this service. See the [wiki][fossgis-project].
879
894
  - The [favicon.png](/img/favicon.png) is based on the file ic_action_add_alarm.png from the [Android Design Icons](https://developer.android.com/downloads/design/Android_Design_Icons_20131106.zip) which is licensed under [Creative Commons Attribution 2.5](https://creativecommons.org/licenses/by/2.5/). It represents a clock next to the most common opening_hours value (by far) which is `24/7` and a check mark.
880
895
 
@@ -888,6 +903,17 @@ As of version 3.4, opening_hours.js is licensed under the [GNU Lesser General Pu
888
903
 
889
904
  Note that the original work from Dmitry Marakasov is published under the BSD 2-clause "Simplified" (BSD-2-Clause) license which is included in this repository under the commit hash [b2e11df02c76338a3a32ec0d4e964330d48bdd2d](https://github.com/opening-hours/opening_hours.js/tree/b2e11df02c76338a3a32ec0d4e964330d48bdd2d).
890
905
 
906
+ <https://reuse.software> is used. The year of initial publication is used and not updated. When you as new author make copyrightable changes, you are free of course to add a `SPDX-FileCopyrightText` line to the file(s) you changed with the year of the contribution. Please use a format like this:
907
+
908
+ ```
909
+ SPDX-FileCopyrightText: © 2021 Humble Hacker <hh@example.org>
910
+ ```
911
+
912
+ See also:
913
+
914
+ - <https://reuse.software/faq/#years-copyright>
915
+ - <https://matija.suklje.name/how-and-why-to-properly-write-copyright-statements-in-your-code#why-not-bump-the-year-on-change>
916
+
891
917
  <!-- Links {{{ -->
892
918
 
893
919
  [nominatim]: https://wiki.openstreetmap.org/wiki/Nominatim#Reverse_Geocoding_.2F_Address_lookup
@@ -923,7 +949,8 @@ Edit: This does also work on npmjs in this short version … -->
923
949
  [ohlib.github]: https://github.com/opening-hours/opening_hours.js
924
950
  [hc]: https://gitlab.com/ypid/hc
925
951
  [evaluation tool]: https://openingh.openstreetmap.de/evaluation_tool/
926
- [schulferien.org]: http://www.schulferien.org/iCal/
952
+ [schulferien.org]: https://www.schulferien.org/deutschland/ical/
953
+ [ph-ar]: https://en.wikipedia.org/wiki/Public_holidays_in_Argentina
927
954
  [ph-at]: https://de.wikipedia.org/wiki/Feiertage_in_%C3%96sterreich
928
955
  [ph-au]: https://en.wikipedia.org/wiki/Public_holidays_in_Australia
929
956
  [ph-be]: https://de.wikipedia.org/wiki/Feiertage_in_Belgien
@@ -934,11 +961,12 @@ Edit: This does also work on npmjs in this short version … -->
934
961
  [ph-cz]: https://en.wikipedia.org/wiki/Public_holidays_in_the_Czech_Republic
935
962
  [ph-de]: https://de.wikipedia.org/wiki/Feiertage_in_Deutschland
936
963
  [ph-dk]: https://en.wikipedia.org/wiki/Public_holidays_in_Denmark
937
- [ph-fr]: https://fr.wikipedia.org/wiki/F%EAtes_et_jours_f%E9ri%E9s_en_France
964
+ [ph-fr]: https://fr.wikipedia.org/wiki/F%C3%AAtes_et_jours_f%C3%A9ri%C3%A9s_en_France
938
965
  [ph-gb]: https://www.gov.uk/bank-holidays#england-and-wales
966
+ [ph-hr]: https://en.wikipedia.org/wiki/Public_holidays_in_Croatia
939
967
  [ph-hu]: https://en.wikipedia.org/wiki/Public_holidays_in_Hungary
940
968
  [ph-ie]: https://en.wikipedia.org/wiki/Public_holidays_in_the_Republic_of_Ireland
941
- [ph-it]: http://www.governo.it/Presidenza/ufficio_cerimoniale/cerimoniale/giornate.html
969
+ [ph-it]: https://presidenza.governo.it/ufficio_cerimoniale/cerimoniale/giornate.html
942
970
  [ph-ne]: https://nl.wikipedia.org/wiki/Feestdagen_in_Nederland
943
971
  [ph-nl]: https://pl.wikipedia.org/wiki/Dni_wolne_od_pracy_w_Polsce
944
972
  [ph-nz]: https://en.wikipedia.org/wiki/Public_holidays_in_New_Zealand