Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Periodic week in a week range -> getNextChange() not work's correctly #409

Open
ocram1095 opened this issue Aug 25, 2021 · 3 comments
Open
Labels
status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation. type: bug A confirmed report of unexpected behavior.

Comments

@ocram1095
Copy link

Good Morning,

for example I have the following osm string: 2021 week 30-52/5 Mo-Fr 07:00-15:30.

The open and closed state works fine! But if I call getNextChange() without arguments the wrong timestamp will be returned (It's not the next one, it's skipping a few).

I think the problem is caused by period >= 5. All numbers < 5 and > 1 work's perfectly.

It is reproducible with the following example or alternatively with the online tool (link of example with my parameters)

const oh = new opening_hours('2021 week 30-52/5 Mo-Fr 07:00-15:30');
console.log(oh.getNextChange(new Date(2021, 07, 25, 9, 27, 0)));

Actual result: Mon Dec 13 2021 07:00:00 GMT+0100 (Mitteleuropäische Normalzeit)
Expected: result Mon Aug 30 2021 07:00:00 GMT+0100 (Mitteleuropäische Normalzeit)

Is that a known limitation or is it a bug?

Thank you!

@ypid ypid added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation. type: bug A confirmed report of unexpected behavior. labels Sep 11, 2021
@ypid
Copy link
Member

ypid commented Sep 11, 2021

Looks like a bug. Do you want to try fixing it?

@HNTQ
Copy link

HNTQ commented Feb 23, 2022

Good morning,

I encounter the same issue with this osm : week 01-53/4 Fr 05:00-13:00; PH off

Sunday Feb 20 Sunday Feb 27 Sunday Feb 27
image image image

Can be tested with online tool using my parameters

week 01-53/2 Fr 05:00-13:00; PH off: Work
week 01-53/3 Fr 05:00-13:00; PH off: Doesn't work

is there any solution or fix?
@ocram1095, do you fix it?

Thank you

@ocram1095
Copy link
Author

@HNTQ Sorry, i don't have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation. type: bug A confirmed report of unexpected behavior.
Projects
None yet
Development

No branches or pull requests

3 participants