Opened 5 years ago
Closed 5 years ago
#18577 closed enhancement (fixed)
[Patch] Update opening_hours.js
Reported by: | simon04 | Owned by: | simon04 |
---|---|---|---|
Priority: | normal | Milestone: | 20.02 |
Component: | Core validator | Version: | |
Keywords: | opening_hours | Cc: | ypid23 |
Description (last modified by )
opening_hours.js has gotten many improvements since its last release on 2017-02-18: https://github.com/opening-hours/opening_hours.js/compare/v3.5.0...master
In particular a rather heavy external library could be removed via https://github.com/opening-hours/opening_hours.js/pull/250
When also excluding the country holiday data via https://github.com/opening-hours/opening_hours.js/pull/314, one can build a opening_hours+deps.min.js
bundle with only 170KB whereas data/validator/opening_hours.js
now has 316KB.
There are the few necessary modifications within JOSM: attachment:18577.patch
Two JOSM tests fail with the new version, however:
java.lang.AssertionError: Expected :isEmpty() Actual :<[service_times - Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00 <--- (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.) => Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00]> at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20) at org.openstreetmap.josm.data.validation.tests.OpeningHourTestTest.testCheckServiceTimeSyntax1(OpeningHourTestTest.java:190) at org.openstreetmap.josm.testutils.JOSMTestRules$CreateJosmEnvironment.evaluate(JOSMTestRules.java:670)
java.lang.AssertionError: opening_hours=sunset-sunrise open; sunrise-sunset closed is valid Expected :isEmpty() Actual :<[opening_hours - sunset-sunrise open; sunrise-sunset closed <--- (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.) => sunset-sunrise open; sunrise-sunset closed]> at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20) at org.openstreetmap.josm.data.validation.tests.OpeningHourTestTest.testPresetValues(OpeningHourTestTest.java:235) at org.openstreetmap.josm.testutils.JOSMTestRules$CreateJosmEnvironment.evaluate(JOSMTestRules.java:670)
Attachments (3)
Change History (9)
by , 5 years ago
Attachment: | 18577.patch added |
---|
comment:1 by , 5 years ago
Description: | modified (diff) |
---|---|
Summary: | Update opening_hours.js → [Patch] Update opening_hours.js |
comment:2 by , 5 years ago
Keywords: | opening_hours added |
---|
by , 5 years ago
Attachment: | opening_hours+deps.min.js added |
---|
by , 5 years ago
Attachment: | 18577-v2.patch added |
---|
comment:3 by , 5 years ago
comment:4 by , 5 years ago
I don’t feel comfortable making release now in that I am not up-to-date with the JavaScript world. The master branch is tested quite a bit so you can go with that. I don’t see an issue.
Thanks again simone04 for all your improvements!
comment:5 by , 5 years ago
Milestone: | → 20.02 |
---|
ypid23, thank you! Let's schedule this patch/update for the 20.02 JOSM release.
The two above "false-positives" (in the JOSM sense) are solved via https://github.com/opening-hours/opening_hours.js/pull/317 and attachment:18577-v2.patch
@team, ypid23: Do we have to wait for a new release of opening_hours.js or can we apply the update rightaway?