-
Notifications
You must be signed in to change notification settings - Fork 116
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
Opening hours across Midnight #88
Comments
Yep, explained here: #22, you can use |
Unfortunately this won't bring the right solution for this:
transformed to:
this won't say |
I don't think we should handle |
Fixed in #90, please try to update to |
Just, wanted to give short feedback: it's working! The " |
Thanks for your feedback! From the README:
|
I'd like to express my interest as well for the possibility to have opening hours across midnight. Although it doesn't make sense technically, opening hours in the format of |
So specifications would be: Instead of having an error if start > end, we would consider start-24:00 + 00:00-end (on the next day) but if I want to display those opening hours, I would still get start-end as in the definition. Right? This change may be considered as breaking because if an application rely on the verification to handle some user input opening hours validation, now it will no longer throw an exception and it may allow inputs the application itself would not be ready to handle. So as long as we don't start a new major release, it must remain an option you first need to enable such as: I'm open to pull-requests for this. |
I think the best way would be to pass a flag when creating the I might have a look at implementing this. If I find a good way to solve this, I'll submit a PR. |
* Add asStructuredData to README usage * Allow on construction for setting a flag for overlapping times. A night club opens that opens till 3am on Friday and Saturday. And modify the API to search for yesterday * Oops, change docs to use overflowing rather than overlapping * Fix styleguide
Explanation about flags pitfalls: #104 (comment) So final API is: $openingHours = \Spatie\OpeningHours\OpeningHours::create([
'overflow' => true,
'friday' => ['20:00-03:00'],
'saturday' => ['20:00-03:00'],
], null); It will be released on 2.2.0. Thank you to @rlweb for the implementation, thank you all for your feedback on this feature. |
Oh nice, that we can now directly create overflowing opening hours. Recently we had some problems with exceptions and overflows. If you have an exception for closed on one day, then of course the overflow should also be closed. Or if you have special overflow opening then the overflow should not overwrite the regular opening hours on next day. Here some example data:
Tests should be:
Can the extension handle that? would be nice if it can ;-) |
Hello @rabauss I do not plan to add this myself right now and as 2.2.0 has been released, I encourage you to create a new issue for this new part of the feature. Maybe you could add your unit tests and submit them as a pull-request. I would merge them on a dedicated branch to the feature so it could help to implement it if someone is interested in proposing a solution for this. |
Is there a way to define Opening Hours accross Midnight??
For example:
If we split into two slots
09:00-23-59
and00:00-03:00
, then at 16:00 thenextClose
would be23:59
instead of03:00
. Has someone a possible solution for that problem?The text was updated successfully, but these errors were encountered: