Comments (4)
I created a failing test case here: francois2metz@9f726b1
from humanized_opening_hours.
Thank you for your report!
It seems quite complicated to fix... I'll take a look in the code ASAP, but I'm not sure it's currently possible to fix this without rewriting a consequent part of the parsing logic (something that I'd like to do, but I currently don't have time).
from humanized_opening_hours.
I looked at the code and managed to fix the problem, while breaking all other features ;)
I don't know if it's feasible to merge some rules when they have the same priority in the function get_current_rule
. What do you think?
from humanized_opening_hours.
Of course, it would be great, but it must be quite difficult to check compatibility of rules before merging. Theoretically, only rules separated by commas should be merged, and rules separated by semicolons should be mutually exclusive. It may be possible to make a patch, but I think a clear handling of that would require an important rewrite of the parsing logic. The grammar specifications are so complicated...
Currently, the main reason the commas are supported is that they're massively wrongly used. They should be used only to merge opening hours of many days spanning over midnight, and many field use them as semicolons. Actually, the parser considers commas as synonyms of semicolons for this reason, because opening hours spanning over midnight are already supported with semicolons (because the parser does not care of the separator).
Also, I think this problem is related with another: when a specific period in a day is defined as closed, the whole day is considered as closed. For example, with Mo-Sa 08:00-19:00; Fr 12:00-14:00 off
, the whole friday is considered as closed (to prevent problems, I raise a ParseError in this case).
from humanized_opening_hours.
Related Issues (20)
- Allow (again) recursion for the `next_change()` method HOT 1
- Allow the separator_for_readability HOT 2
- Need some feedbacks!
- Add translations for other languages HOT 8
- Wrong first day of week HOT 3
- The pt translation requires a different approach on reference to the days of the week HOT 4
- MonthDayRange over 2 implicit years HOT 4
- Parsing Failure against Non-standard DoW and presence of 'AM' and / or 'PM' HOT 2
- Max recursions error in next_change() function HOT 1
- Allow times which span over midnight HOT 2
- Dynamic Earley (lark) error HOT 2
- Unspecified closing time not supported HOT 1
- Alternate week_description() returning a list HOT 3
- Parsing a description ? (reverse parsing) HOT 3
- unexpected keyword argument 'locale'
- Memoize get_parser HOT 3
- Can't parse comma-separated ranges HOT 1
- Avoid sys.path[0] for finding setup.py directory HOT 4
- get_locale_day() Missing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from humanized_opening_hours.