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:00Apr, Mo 08:00-18:00Apr, Mo 08:002024, Mo 08:00Apr 01, Mo 08:00Apr 01, Mo sunrise2024, Mo,PH 08:00week 01-52, Mo 08:00
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 toApr-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 removedApr-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 (notPH
/SH
!) follows any wide range selector