Opened 4 years ago
Last modified 4 years ago
#18892 new enhancement
Features missing in OpeningHoursParser compared to JS library
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 )
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>
forFr-We,PH 10:00-17:00; Fr PH +1 day off
Holiday after weekday at line 1, column 10
foropening_hours=Mo-Su,PH 10:00-21:30
Encountered: <HYPHEN> "- " at line 1, column 14Was expecting: <EOF>
for10: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 ofMai
andDez
.
See https://github.com/simonpoole/OpeningHoursParser/issues/42
Finally, the parser in strict mode is stricter than the JS. See #18899 and #19571
Attachments (0)
Change History (9)
follow-up: 3 comment:1 by , 4 years ago
comment:2 by , 4 years ago
Description: | modified (diff) |
---|
comment:3 by , 4 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 , 4 years ago
Description: | modified (diff) |
---|
comment:5 by , 4 years ago
Keywords: | opening_hours added; opening hour OpeningHoursParser removed |
---|
comment:6 by , 4 years ago
Cc: | added |
---|
comment:7 by , 4 years ago
Description: | modified (diff) |
---|
comment:9 by , 4 years ago
Description: | modified (diff) |
---|
Thanks for your summary.
Replying to skyper:
Therefore, the feature is kept. :) For instance, try validating and fixing
opening_hours=Mo-Fr 7-19