Giter Club home page Giter Club logo

Comments (4)

rezemika avatar rezemika commented on August 16, 2024

Thank you for your feedback!

It's fixed by the commit 20e1bad, and I just sent the update to PyPi. You can update your version to 1.0.0b3. ;)

from humanized_opening_hours.

jbgriesner avatar jbgriesner commented on August 16, 2024

Thanks for your fast answer!

However your fix seems not perfect yet: indeed if you add to your test different months starting from the "next" year it fails:

>>> oh = OHParser("Oct-Mar 07:30-19:30; Apr-Sep 07:00-21:00")
>>> oh.is_open(datetime.datetime(2019, 1, 1, 12, 30))   # 1st Jan: it should be open...
False
>>> oh.is_open(datetime.datetime(2019, 2, 1, 12, 30))   # 1st Feb: it should be open...
False
>>> oh.is_open(datetime.datetime(2019, 3, 1, 12, 30))   # 1st March: it should be open...
False

This is due to the 52 weeks shift of the current year, which makes the "query date" outside of the opening hours limits.

from humanized_opening_hours.

rezemika avatar rezemika commented on August 16, 2024

Well, you're right. However, I don't see how to fix this properly (sorry)...
Do you have any suggestion?

from humanized_opening_hours.

jbgriesner avatar jbgriesner commented on August 16, 2024

Please find my suggestion in PR #27

I think it should fix these tricky cases

from humanized_opening_hours.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.