Index: trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java	(revision 6375)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java	(revision 6376)
@@ -54,5 +54,7 @@
         if (ENGINE != null) {
             ENGINE.eval(new InputStreamReader(new MirroredInputStream("resource://data/opening_hours.js"), "UTF-8"));
-            ENGINE.eval("var oh = function (x, y) {return new opening_hours(x, y);};");
+            // fake country/state to not get errors on holidays
+            ENGINE.eval("var nominatiomJSON = {address: {state: 'Bayern', country_code: 'de'}};");
+            ENGINE.eval("var oh = function (value, mode) {return new opening_hours(value, nominatiomJSON, mode);};");
         } else {
             Main.warn("Unable to initialize OpeningHourTest because no JavaScript engine has been found");
@@ -60,6 +62,15 @@
     }
 
-    protected Object parse(String value) throws ScriptException, NoSuchMethodException {
-        return ((Invocable) ENGINE).invokeFunction("oh", value);
+    static enum CheckMode {
+        TIME_RANGE(0), POINTS_IN_TIME(1), BOTH(2);
+        final int code;
+
+        CheckMode(int code) {
+            this.code = code;
+        }
+    }
+
+    protected Object parse(String value, CheckMode mode) throws ScriptException, NoSuchMethodException {
+        return ((Invocable) ENGINE).invokeFunction("oh", value, mode.code);
     }
 
@@ -104,10 +115,10 @@
      * @return a list of {@link TestError} or an empty list
      */
-    public List<TestError> checkOpeningHourSyntax(final String value) {
+    public List<TestError> checkOpeningHourSyntax(final String value, CheckMode mode) {
         if (ENGINE == null || value == null || value.trim().isEmpty()) {
             return Collections.emptyList();
         }
         try {
-            final Object r = parse(value);
+            final Object r = parse(value, mode);
             final List<TestError> errors = new ArrayList<TestError>();
             for (final Object i : getList(((Invocable) ENGINE).invokeMethod(r, "getWarnings"))) {
@@ -117,5 +128,5 @@
         } catch (ScriptException ex) {
             final String message = ex.getMessage()
-                    .replace("sun.org.mozilla.javascript.internal.JavaScriptException: ", "opening_hours - ")
+                    .replaceAll("[^:]*Exception: ", "opening_hours - ")
                     .replaceAll("\\(<Unknown source.*", "")
                     .trim();
@@ -126,6 +137,10 @@
     }
 
-    protected void check(final OsmPrimitive p, final String tagValue) {
-        for (TestError e : checkOpeningHourSyntax(tagValue)) {
+    public List<TestError> checkOpeningHourSyntax(final String value) {
+        return checkOpeningHourSyntax(value, CheckMode.TIME_RANGE);
+    }
+
+    protected void check(final OsmPrimitive p, final String tagValue, CheckMode mode) {
+        for (TestError e : checkOpeningHourSyntax(tagValue, mode)) {
             e.setPrimitives(Collections.singletonList(p));
             errors.add(e);
@@ -134,8 +149,7 @@
 
     protected void check(final OsmPrimitive p) {
-        check(p, p.get("opening_hours"));
-        // unsupported, cf. https://github.com/AMDmi3/opening_hours.js/issues/12
-        //check(p, p.get("collection_times"));
-        //check(p, p.get("service_times"));
+        check(p, p.get("opening_hours"), CheckMode.TIME_RANGE);
+        check(p, p.get("collection_times"), CheckMode.BOTH);
+        check(p, p.get("service_times"), CheckMode.BOTH);
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java	(revision 6375)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java	(revision 6376)
@@ -61,5 +61,29 @@
         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("badtext").size(), is(1));
         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("badtext").get(0).getMessage(),
-                is("ba <--- (Unexpected token: \"b\" This means that the syntax is not valid at that point or it is currently not supported.)"));
+                is("opening_hours - ba <--- (Unexpected token: \"b\" This means that the syntax is not valid at that point or it is currently not supported.)"));
+    }
+
+    @Test
+    public void testCheckOpeningHourSyntax6() throws Exception {
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("PH open \"always open on public holidays\"").isEmpty(), is(true));
+    }
+
+    @Test
+    public void testCheckServiceTimeSyntax1() throws Exception {
+        // frequently used tags according to http://taginfo.openstreetmap.org/keys/service_times#values
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("Su 10:00", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(true));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("automatic", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(false));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("Mo-Sa 09:00-18:00", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(true));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("Su 09:30; We 19:30", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(true));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(true));
+    }
+
+    @Test
+    public void testCheckCollectionTimeSyntax1() throws Exception {
+        // frequently used tags according to http://taginfo.openstreetmap.org/keys/collection_times#values
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("Mo-Sa 09:00", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(true));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("fixme", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(false));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("daily", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(false));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(true));
     }
 }
