Modify

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 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 and #19571

Attachments (0)

Change History (9)

in reply to:  description ; comment:1 by simon04, 4 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, 4 years ago

Description: modified (diff)

in reply to:  1 comment:3 by skyper, 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 skyper, 4 years ago

Description: modified (diff)

comment:5 by Don-vip, 4 years ago

Keywords: opening_hours added; opening hour OpeningHoursParser removed

comment:6 by Don-vip, 4 years ago

Cc: SimonPoole added

comment:7 by skyper, 4 years ago

Description: modified (diff)

comment:8 by skyper, 4 years ago

Description: modified (diff)

added strict mode

comment:9 by skyper, 4 years ago

Description: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to skyper.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.