Opened 5 years ago

Last modified 5 years ago

#18892 new enhancement

Features missing in OpeningHoursParser compared to JS library — at Version 8

Reported by: skyper Owned by: team
Priority: normal Milestone:
Component: Core validator Version:
Keywords: opening_hours auto fix message Cc: simon04, SimonPoole

Description (last modified by skyper)

In r15978 the switch from JS did take place, see #18140.

Some features got lost, namely:

  • option to automatically fix some issues
    • e.g. all three examples mentioned below

The automatically fix was a great feature and I will miss it.

  • human readable messages e.g.:
    • Encountered " <HOLIDAYS> "PH "" at line 1, column 26Was expecting: <EOF> for Fr-We,PH 10:00-17:00; Fr PH +1 day off
    • Holiday after weekday at line 1, column 10 for opening_hours=Mo-Su,PH 10:00-21:30
    • Encountered: <HYPHEN> "- " at line 1, column 14Was expecting: <EOF> for 10:00-17:00; Jan-Mai,Nov-Dec Mo off; PH,SH Mo 09:00-17:00

The messages should display the string with highlighted errors instead of the line and column
In JS, the messages displayed the string from the start to the position the error occurred but that does not work for multiple errors. See #18807

  • flagging all errors in one value e.g.:
    • 10:00-17:00; Jan-Mai,Nov-Dez Mo off; PH,SH Mo 09:00-17:00; Mai 1 off should flag both occurrences of Mai and Dez.

See https://github.com/simonpoole/OpeningHoursParser/issues/42


Finally, the parser in strict mode is stricter than the JS. See #18899

Change History (8)

in reply to:  description ; comment:1 by simon04, 5 years ago

Thanks for your summary.

Replying to skyper:

The automatically fix was a great feature and I will miss it.

Therefore, the feature is kept. :) For instance, try validating and fixing opening_hours=Mo-Fr 7-19

comment:2 by skyper, 5 years ago

Description: modified (diff)

in reply to:  1 comment:3 by skyper, 5 years ago

Replying to simon04:

Thanks for your summary.

You are welcome

Replying to skyper:

The automatically fix was a great feature and I will miss it.

Therefore, the feature is kept. :) For instance, try validating and fixing opening_hours=Mo-Fr 7-19

Not for all issues. I adjusted the description. Sadly, the complex ones are not supported, yet.

comment:4 by skyper, 5 years ago

Description: modified (diff)

comment:5 by Don-vip, 5 years ago

Keywords: opening_hours added; opening hour OpeningHoursParser removed

comment:6 by Don-vip, 5 years ago

Cc: SimonPoole added

comment:7 by skyper, 5 years ago

Description: modified (diff)

comment:8 by skyper, 5 years ago

Description: modified (diff)

added strict mode

Note: See TracTickets for help on using tickets.