opening_hours 3.10.0 → 3.11.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/CHANGELOG.md CHANGED
@@ -8,6 +8,76 @@ SPDX-License-Identifier: LGPL-3.0-only
8
8
 
9
9
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
10
10
 
11
+ ## [3.11.0](https://github.com/opening-hours/opening_hours.js/compare/v3.10.0...v3.11.0) (2026-01-25)
12
+
13
+
14
+ ### Features
15
+
16
+ * add helpful error message for invalid variable time offset syntax ([c817897](https://github.com/opening-hours/opening_hours.js/commit/c8178976b7e5868f3b02e309f3af57af3735ba1c))
17
+ * **evaluation-tool:** improve diff comparison UX and dark mode ([b63ca2d](https://github.com/opening-hours/opening_hours.js/commit/b63ca2d51e7c818dacfcd9c15ff6d602efa7f347))
18
+ * **evaluation-tool:** improve language selection UX ([d2e8dec](https://github.com/opening-hours/opening_hours.js/commit/d2e8dec6a1153253e330663b8daac8dae52f4722))
19
+ * **evaluation-tool:** modernize UI with dark mode and responsive design ([f706813](https://github.com/opening-hours/opening_hours.js/commit/f7068138da13e7a51a63fb710241914b9411b6bb))
20
+ * **evaluation-tool:** redesign status display with timeline and improved table ([5d060a8](https://github.com/opening-hours/opening_hours.js/commit/5d060a8d7831d2122d02c098dc6f5a4bc71ea28f))
21
+ * **holidays:** migrate school holidays to OpenHolidays data ([b9b48f0](https://github.com/opening-hours/opening_hours.js/commit/b9b48f01eddbec261ccdb4d2de9f2319129e965c))
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * add missing else in formatWarnErrorMessage function ([4c41166](https://github.com/opening-hours/opening_hours.js/commit/4c41166f3e3dbcf80fa95722d5b6ad330f19594e))
27
+ * **evaluation-tool:** fix specification links in value_explanation ([6807459](https://github.com/opening-hours/opening_hours.js/commit/680745923629cfa15a8051d9e045d95141910b86)), closes [#546](https://github.com/opening-hours/opening_hours.js/issues/546)
28
+ * remove redundant console logs from formatWarnErrorMessage function ([78d6395](https://github.com/opening-hours/opening_hours.js/commit/78d63952fc62bd581aaae31a2c0a1204015d5e09))
29
+ * **scripts:** handle empty/invalid JSON files in real_test.js ([bab7f5a](https://github.com/opening-hours/opening_hours.js/commit/bab7f5a093eedff14a1ec5e88fd2a7117916564e))
30
+ * **tooling:** fix taginfo downloads with pagination support ([7b5d777](https://github.com/opening-hours/opening_hours.js/commit/7b5d777d75be33d5d5f14b186602428e70bbfe05))
31
+
32
+
33
+ ### Data Updates
34
+
35
+ * **fr:** add 2026-2027 school holidays and fix 2024 dates ([383525e](https://github.com/opening-hours/opening_hours.js/commit/383525eac0a45dbc23e5fd484f6b2c44566ededb))
36
+ * update Argentina 2026 public holidays ([73eb195](https://github.com/opening-hours/opening_hours.js/commit/73eb195d2b59b6b2d1727da694de31539e5a6b0e))
37
+
38
+
39
+ ### Documentation
40
+
41
+ * `build` is not a valid commit scope to avoid `build(build)` ([f26b82b](https://github.com/opening-hours/opening_hours.js/commit/f26b82b6ef82d75a171f1c5f63fcc9fe9421e3a2))
42
+ * add `evaluation-tool` as common git commit scope ([93a13d7](https://github.com/opening-hours/opening_hours.js/commit/93a13d72eb19461bed053e2b93c57d71a51e53ae))
43
+ * do not overuse the term "main" to avoid confusion ([4bf17d8](https://github.com/opening-hours/opening_hours.js/commit/4bf17d8be6e082c8fc0b56c19c55691154732030))
44
+ * **evaluation-tool:** remove term "GPG" from noscript HTML tag ([aa8e75c](https://github.com/opening-hours/opening_hours.js/commit/aa8e75c621154f2067dc65620b15d8efa8625e16))
45
+ * give more specific commit message example ([972558c](https://github.com/opening-hours/opening_hours.js/commit/972558c0a1ff7d29faf09c0b7fb4ca445b4a527c))
46
+ * **readme:** mention Major Evaluation Tool Redesign under Maintainers ([5d076c8](https://github.com/opening-hours/opening_hours.js/commit/5d076c84f8dffa75621c9e53fd02569ec68c827f)), closes [#542](https://github.com/opening-hours/opening_hours.js/issues/542)
47
+ * update osm-tag-data-check to osm-tag-data-taginfo-check ([25812d6](https://github.com/opening-hours/opening_hours.js/commit/25812d6c6c3da2d89966e5f6d523cd480d0044b1))
48
+ * update Releasing section ([7c0da2f](https://github.com/opening-hours/opening_hours.js/commit/7c0da2f554275cca35d99cafdd3dfb2c4b99a324))
49
+ * update VCS URL of YoHours ([6974460](https://github.com/opening-hours/opening_hours.js/commit/6974460d052b7ef3e29ae6934c1001c36afea401))
50
+
51
+
52
+ ### Code Refactoring
53
+
54
+ * **evaluation-tool:** export module state from helpers/main instead of window globals ([acb9393](https://github.com/opening-hours/opening_hours.js/commit/acb9393717711b5226477d9ebdb78ae0adfca973))
55
+ * **evaluation-tool:** extract inline scripts ([680d323](https://github.com/opening-hours/opening_hours.js/commit/680d32328ca3d5f992ef29b05d8f03a3e7beb998))
56
+ * **evaluation-tool:** improve handleDiffComparison type safety and readability ([84fa9a8](https://github.com/opening-hours/opening_hours.js/commit/84fa9a8711b78c7084c528c7794085fa63d7e0f7))
57
+ * **evaluation-tool:** improve readability of generateValueExplanation ([73ac361](https://github.com/opening-hours/opening_hours.js/commit/73ac36193f18df4408de1297e5850b986d94008d))
58
+ * **evaluation-tool:** merge example lists ([1ec616a](https://github.com/opening-hours/opening_hours.js/commit/1ec616a34f6bfeacc314454e1d08339d7de613d9)), closes [#103](https://github.com/opening-hours/opening_hours.js/issues/103)
59
+ * **evaluation-tool:** migrate to ES modules ([714eb22](https://github.com/opening-hours/opening_hours.js/commit/714eb22d25c044dc664b0486b3afe6b015f3a7de))
60
+ * **evaluation-tool:** modernize Nominatim geocoding ([4e0b3d8](https://github.com/opening-hours/opening_hours.js/commit/4e0b3d8b9ac108c1261fe02383aab8329bbb32a6))
61
+ * **evaluation-tool:** move script tags to head with defer ([18b0499](https://github.com/opening-hours/opening_hours.js/commit/18b049999a65f2d2eaaaa885a739af119121c5fb))
62
+ * **evaluation-tool:** remove unused hidden iframe ([9f7bced](https://github.com/opening-hours/opening_hours.js/commit/9f7bced69f33d3cb67aafc23b543678f296cde8d))
63
+ * **evaluation-tool:** rename printDate func to toISODateString ([d15af56](https://github.com/opening-hours/opening_hours.js/commit/d15af566a8664fd3ac47cd6ced03999894f18b66))
64
+ * **evaluation-tool:** replace `javascript:` URLs with event delegation ([3172e07](https://github.com/opening-hours/opening_hours.js/commit/3172e0768d8f90fe20a8e5c2fb974455a1e7ed8d))
65
+ * **evaluation-tool:** replace jQuery with modern vanilla JavaScript ([7e450d0](https://github.com/opening-hours/opening_hours.js/commit/7e450d099103c012d512f81f65115ed60326c024))
66
+ * **evaluation-tool:** replace repetitive inline handlers with event delegation ([b3cf85f](https://github.com/opening-hours/opening_hours.js/commit/b3cf85fca535d3cd09a5930c1208b89ffe14e52b))
67
+ * **evaluation-tool:** replace XMLHttpRequest with fetch API ([190989d](https://github.com/opening-hours/opening_hours.js/commit/190989d6ed14ef1cb9af4456aa30bde064fa9a4e))
68
+ * **evaluation-tool:** simplify and modernize permalink generation ([aa06419](https://github.com/opening-hours/opening_hours.js/commit/aa06419823316da6fe2a22a55afb7fcfbc77920f))
69
+ * **evaluation-tool:** simplify initialization flow ([72f5e9c](https://github.com/opening-hours/opening_hours.js/commit/72f5e9c4d6e3f8a549455de58cde899e75d00405))
70
+ * **evaluation-tool:** streamline DOM manipulation by removing unnecessary checks ([1ca6e20](https://github.com/opening-hours/opening_hours.js/commit/1ca6e20ed826eee2fa4c6452e29479a1e83597f3))
71
+ * **evaluation-tool:** use semantic HTML elements ([b5b8fe7](https://github.com/opening-hours/opening_hours.js/commit/b5b8fe799dc30957ca8ab28bae805fb7801b4f1c))
72
+ * **evaluation-tool:** use template literals and const/let ([386d600](https://github.com/opening-hours/opening_hours.js/commit/386d600aeeb87ad7d41551beb39ada16ce713781))
73
+ * **evaluation-tool:** use URLSearchParams in page initialization ([3851dfb](https://github.com/opening-hours/opening_hours.js/commit/3851dfb21711a2b62a98b02c9949496b7a2c0ddf))
74
+ * **holiday:** extract parseSingleHolidayToken and simplify main loop ([3b593f9](https://github.com/opening-hours/opening_hours.js/commit/3b593f9ab9eb0e9a4ade675af5a6931213dcc79e))
75
+ * **PH:** extract public holiday selector as standalone function ([e5d4aa1](https://github.com/opening-hours/opening_hours.js/commit/e5d4aa1b6f332f004f7f9fd8a6cbf2ae95ce59d6))
76
+ * replace i18next with lightweight custom i18n in core library ([96972fd](https://github.com/opening-hours/opening_hours.js/commit/96972fda2ee702767b8928024531071a37db193a))
77
+ * **SH:** extract helper functions for date/range handling ([217b4e9](https://github.com/opening-hours/opening_hours.js/commit/217b4e9fda4279c861e71a4ba1548c8518684934))
78
+ * **SH:** extract school holiday selector as standalone function ([85692a1](https://github.com/opening-hours/opening_hours.js/commit/85692a1f8c2e891a5934ddd6747fa332f1240a89)), closes [#75](https://github.com/opening-hours/opening_hours.js/issues/75)
79
+ * **SH:** make school holiday parsing independent of data order ([7320458](https://github.com/opening-hours/opening_hours.js/commit/7320458df7426a41c226448fd76d9583bbf8acab))
80
+
11
81
  ## [3.10.0](https://github.com/opening-hours/opening_hours.js/compare/v3.10.0-rc.1...v3.10.0) (2025-12-22)
12
82
 
13
83
  ## [3.10.0-rc.1](https://github.com/opening-hours/opening_hours.js/compare/v3.10.0-rc.0...v3.10.0-rc.1) (2025-12-21)
package/Makefile CHANGED
@@ -231,6 +231,7 @@ check-html:
231
231
  ## }}}
232
232
 
233
233
  ## release {{{
234
+ # See CONTRIBUTING.md "Releasing"
234
235
 
235
236
  .PHONY: release-prepare
236
237
  release-prepare: package.json taginfo.json check-holidays doctoc check
@@ -248,8 +249,9 @@ release-local-resign-tag: package.json
248
249
 
249
250
  .PHONY: release-publish
250
251
  release-publish:
251
- git push --follow-tags
252
+ git push --follow-tags origin
252
253
  npm publish
254
+ @echo "Manually create release on https://github.com/opening-hours/opening_hours.js/releases"
253
255
  # $(MAKE) $(MAKE_OPTIONS) publish-website-on-all-servers
254
256
 
255
257
  .PHONY: release
@@ -281,8 +283,11 @@ export.happy_hours.json:
281
283
  export.opening_hours.json:
282
284
  export.lit.json:
283
285
 
286
+ # Downloads taginfo data for the specified key.
287
+ # By default, all values are downloaded. To limit:
288
+ # make osm-tag-data-taginfo-check MAX_VALUES=10000
284
289
  export.%.json:
285
- wget $(WGET_OPTIONS) --output-document="$(shell echo "$@" | sed 's/\\//g' )" "$(API_URL_TAGINFO)/4/key/values?key=$(shell echo "$@" | sed 's/^export\.\(.*\)\.json/\1/;s/\\//g' )" 2>&1
290
+ @$(NODEJS) scripts/download_taginfo_data.mjs "$@" "$(shell echo "$@" | sed 's/^export\.\(.*\)\.json/\1/;s/\\//g' )" "$(MAX_VALUES)"
286
291
  ## }}}
287
292
 
288
293
  ## OSM data from the overpass API {{{
package/README.md CHANGED
@@ -318,7 +318,7 @@ function getReadableState(startString, endString, oh, past) {
318
318
  7: debug
319
319
  ```
320
320
 
321
- - `locale (type: string, default: i18next.language || 'en')`: Defines the locale for errors and warnings.
321
+ - `locale (type: string, default: 'en')`: Defines the locale for errors and warnings. Currently, only 'en' (English) and 'de' (German) are supported.
322
322
 
323
323
  - additional_rule_separator (type boolean, default true)`: Allows to disable the "additional_rule_separator not used after time wrapping midnight" check giving rise to the warning "This rule overwrites parts of the previous rule. This happens because normal rules apply to the whole day and overwrite any definition made by previous rules. You can make this rule an additional rule by using a "," instead of the normal ";" to separate the rules. Note that the overwriting can also be desirable in which case you can ignore this warning."
324
324
 
@@ -611,17 +611,13 @@ Almost everything from opening_hours definition is supported, as well as some ex
611
611
 
612
612
  - Support for school holidays (`SH 10:00-14:00`).
613
613
 
614
- - Countries with SH definition:
614
+ School holidays are automatically sourced from the [OpenHolidays API](https://openholidaysapi.org) for 33 countries (from 2020 onwards). Update data by running:
615
615
 
616
- - Austria (national until 2024, regional until 2021)
617
- - Belgium (good until 2026)
618
- - Croatia (good until 2022–2023)
619
- - France (good until 2025)
620
- - Germany, see [hc] and [scripts/update_german_sh.mjs](scripts/update_german_sh.mjs) (good until 2026)
621
- - Greece (good until 2020)
622
- - Hungary (good until 2024–2025)
623
- - Luxembourg (good until 2025–2026)
624
- - Romania (good until 2021)
616
+ ```bash
617
+ node scripts/fetch-school-holidays.mjs
618
+ ```
619
+
620
+ For details see [src/holidays/README.md](src/holidays/README.md).
625
621
 
626
622
  - There can be two cases which need to be separated (this applies for PH and SH):
627
623
 
@@ -703,10 +699,11 @@ The current results of this test are also tracked in the repository and can be v
703
699
 
704
700
  #### Large scale
705
701
 
706
- To see how this library performances in the real OpenStreetMap world you can run `make osm-tag-data-check` or `node scripts/real_test.js` (data needs to be exported first) to try to process every value which uses the opening_hours syntax from [taginfo] with this library.
702
+ To see how this library performs in the real OpenStreetMap world you can run `make osm-tag-data-taginfo-check` to test the parser with real data from [taginfo].
703
+
704
+ By default, the test downloads **all available values** from taginfo. As of December 2025, this library can parse **99.3%** of all opening_hours values in OSM (955,260/978,867 unique values, with duplicates: 4,358,786 total). If identical values appear multiple times, each occurrence counts.
707
705
 
708
- Currently (Mai 2015) this library can parse 97 % (383990/396167) of all opening_hours values in OSM. If identical values appear multiple times then each value counts.
709
- This test is automated by now. Have a look at the [opening_hours-statistics][].
706
+ For faster testing during development, you can limit the number of values: `make osm-tag-data-taginfo-check MAX_VALUES=10000`
710
707
 
711
708
  #### Small scale
712
709
 
@@ -743,7 +740,7 @@ This library is known to the used by the following projects:
743
740
  | [OpenBeerMap](https://openbeermap.github.io) | [issue for integration](https://github.com/OpenBeerMap/OpenBeerMap.github.io/issues/25) |
744
741
  | [opening_hours_map] |
745
742
  | [ulm-opening-hours](https://github.com/cmichi/ulm-opening-hours) |
746
- | [YoHours][] | A simple editor for OpenStreetMap opening hours, [GitHub](https://github.com/PanierAvide/panieravide.github.io/tree/master/yohours) |
743
+ | [YoHours][] | A simple editor for OpenStreetMap opening hours, [source code](https://framagit.org/PanierAvide/YoHours) |
747
744
  | [opening_hours_server.js] | A little server answering query‘s for opening_hours and check if they can be evaluated. |
748
745
  | [opening_hours-statistics] | Visualization of the data quality and growth over time in OSM. |
749
746
  | [www.openstreetmap.hu](https://www.openstreetmap.hu/) | old version of this library, see also <https://github.com/AMDmi3/opening_hours.js/issues/19> |
@@ -819,7 +816,7 @@ If you want to contribute to this project, please read the [contribution guideli
819
816
 
820
817
  * [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.
821
818
  * [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]).
822
- * [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.
819
+ * [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. Major [evaluation tool][ohlib.evaluation-tool] Redesign.
823
820
 
824
821
  ## Contributors
825
822
 
@@ -829,7 +826,7 @@ Refer to the [Changelog](https://github.com/opening-hours/opening_hours.js/blob/
829
826
 
830
827
  - [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 :) )
831
828
  - Also thanks to FOSSGIS for hosting a public instance of this service. See the [wiki][fossgis-project].
832
- - 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.
829
+ - The [favicon.svg](/img/favicon.svg) 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.
833
830
 
834
831
  ## Stats
835
832
 
@@ -875,7 +872,6 @@ Edit: This does also work on npmjs in this short version … -->
875
872
  [ohlib.library-api]: #library-api
876
873
  [ohlib.npmjs]: https://www.npmjs.org/package/opening_hours
877
874
  [ohlib.github]: https://github.com/opening-hours/opening_hours.js
878
- [hc]: https://gitlab.com/ypid/hc
879
875
  [evaluation tool]: https://openingh.openstreetmap.de/evaluation_tool/
880
876
  [ph-ar]: https://en.wikipedia.org/wiki/Public_holidays_in_Argentina
881
877
  [ph-at]: https://de.wikipedia.org/wiki/Feiertage_in_%C3%96sterreich