Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignoring of dangling , after wide range inconsistent #89

Open
westnordost opened this issue Jan 12, 2024 · 1 comment
Open

Ignoring of dangling , after wide range inconsistent #89

westnordost opened this issue Jan 12, 2024 · 1 comment

Comments

@westnordost
Copy link
Contributor

westnordost commented Jan 12, 2024

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

If it was not changed, the , would be an additional rule separator, making the whole expression mean something else.

This is not documented in the specification, but as far as I can see, it makes sense:

For all opening hours strings I've looked at that had such a dangling , , this parsing behavior made sense - for it each matched the intention of the author. In any case, while this behavior is consistent in opening_hours.js, it is only done in specific situations for this parser:

, is removed

Apr-Oct, Mo 08:00-18:00
Apr, Mo 08:00-18:00
Apr, Mo 08:00
2024, Mo 08:00
Apr 01, Mo 08:00
Apr 01, Mo sunrise
2024, Mo,PH 08:00
week 01-52, Mo 08:00

, is not removed (-> additional rule)

Apr, 08:00
2024, 08:00
Apr, sunrise
2024, PH 08:00
2024, PH,Mo 08:00

In conclusion, , is only removed if a weekday (not PH/SH!) follows any wide range selector

@simonpoole
Copy link
Owner

This would seem to be related to #81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants