OpeningHoursParser icon indicating copy to clipboard operation
OpeningHoursParser copied to clipboard

Parser for string values according to the OSM opening hours specification

Results 13 OpeningHoursParser issues
Sort by recently updated
recently updated
newest added

The readme states: > In non-strict mode the following further differences are allowed: > [...] > - superfluous ":" after weekday range However, `Mo-Fr: 12:00` is parsed without error also...

This parser, and also the reference implementation ignores a dangling `,` at the end of a wide range. E.g. `Apr-Oct,Mo-Fr 08:00-18:00` is (interpreted as and) changed to `Apr-Oct Mo-Fr 08:00-18:00`...

Rather than creating a new ticket for each of these, a list. Feel free to cross any out that you do not find meaningful to implement - [ ] accept...

According to the specification https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#explain:additional_rule_separator , the additional rule separator may only follow after either of a time selector, a rule modifier or a comment. For example `Mo-Th, Jun-Jul Fr`...

invalid

The syntax ` []` is not documented in the spec, although it is supported both by this parser and also the opening_hours.js

This library beautifies time ranges like - `16:00-0:00` => `16:00-24:00` - `16:00-28:00` => `16:00-04:00` When the start time is an event time, this is however not done, which seems a...

enhancement

e.g. `Jan-Dec 1-31/2` -> "Open every odd day of month" or the same for every even day of a month. ### Use case Currently, the way to express the above...

See https://twitter.com/mtmthemovie/status/1290018491089563648 in non-strict mode this might make sense as it could easily be used instead of a semi-colon.

enhancement

Does allowing this make any sense? If it does it should definitely throw an exception in strict mode.

question
low priority

Support evaluation of the OH values.

enhancement