Readit News logoReadit News
de6u99er · 5 years ago
From my experience it is a common mistake to do overlap comparisons of intervals this way.

https://github.com/fmeringdal/nettu-scheduler/blob/df737e128...

IMO start time should be treated as inclusive, and end time as exclusive.

E.g. an event from 1pm-2pm does not overlap with an event starting at 2pm because it's end-time is defined as exclusive.

Therefore you need to replace one of you greater/lower-than's with a normal greater/lower comparison operator.

fmeringdal · 5 years ago
Thanks for your feedback! I will look into it :)
de6u99er · 5 years ago
No problem. Took me 2 min to find it. I actually searched for the term "overlap" to see if you're doing it correctly ;)

At least you're using one if statement. Many do interval overlap comparisons with two if statements.

klinskyc · 5 years ago
Very cool, and nice to see more options here (especially open source ones). I remember looking five years ago, and being very surprised that there was no Stripe-equivalent for adding scheduling to an application.

Between this, https://www.timekit.io/, and https://www.spurwing.io/ (which is my project), hopefully people will stop re-inventing the scheduling wheel with each project.

fmeringdal · 5 years ago
Your project looks awesome, thanks for sharing! And yeah, hopefully new booking apps will have a lot of better options now than implementing the scheduling stuff themselves.
Arcanum-XIII · 5 years ago
I would love to be able to use off the shelf software, sadly I have to integrate with an internal prosumer software. It's ugly to say the least to get the data, there's no proper sync flow, it's heavily rate limited... And I have no control over it. I would love to move the scheduling outside this software, but sadly it handle other part of the logistic flow needed (book some items, get ready the work order...)

So yeah. Booking is dead simple. If you don't have a complete logistic flow added on top of it.

encryptluks2 · 5 years ago
Does this support CalDav? I'd be more interested in a self-hosted calendar with CalDav integration. Then for appointments/scheduling, utilizing a separate calendar designated to a single or multiple other calendars that looks for free/busy information.
fmeringdal · 5 years ago
It does not support CalDav right now. The reason being that I didnt need CalDav when i developed the project. That being said, a lot of people have asked for CalDav support after I launched so it is going to be a prioritized feature moving forward.
rodolphoarruda · 5 years ago
This is nice. It gave an insight about something similar that could be developed as an extension to WMSes (warehouse management systems) in use by Logistics Operators.

The product would work as a openly accessible integration layer to the WMS -- which is usually hard to integrate to any system. Customers or partners to this warehouse could use the SDK to develop integrations on their side to favor inter company workflows or even brand new products that would rely on that warehouse somehow. Business model could be similar to Bitnami's plus customer support plans.

fmeringdal · 5 years ago
That sounds like a great idea!
manofsky · 5 years ago
OMG too funny just today posted on show a new my graphql calendar api. hated what I found when we needed to schedule in-app appointments. so I ended up creating my own http://www.ezcaldev.com

looking forward to learn more about this one

e12e · 5 years ago
Apparently your show hn was killed - not sure why?

https://news.ycombinator.com/item?id=26627450

fmeringdal · 5 years ago
Thats awesome! Is it open-source? Would love to see how it works internally and see how it differs from my implementation.
arez · 5 years ago
I implemented a similar thing myself at my current job. How did you deal with events that happen once a week and someone creating an event in 2020 and one for 2024 every monday let's say. Do you project the recurring events into the future and see if they overlap?
fmeringdal · 5 years ago
Cool! I would be happy to explain the internals of the projects. Do you mind reformulating your question? I am not sure I understood it correctly...
dsalzman · 5 years ago
This is great. It almost handles a use case I’ve been looking for which is a slimmed down version of Calendly. Basically merge multiple personal/work calendars into a single free/busy calendar I can share with my wife/family.
fmeringdal · 5 years ago
Hi, there is a get user freebusy endpoint in the api that allows querying free busy information on a given set of calendars owned by that user. Is that what your are looking for? If not, would you like to create an issue in the repo which describes your needs? :)
dsalzman · 5 years ago
Yeah. I want to combine multiple cals into a single cal with only free/busy that i can then publicly share/ give out to my friends/family
barhum · 5 years ago
I am trying to build a SAAS service for booking services. One of the engineering issues I ask myself is if the following will become an issue in the future: do I save all the options of slots available I show each customer in the database or do I just calculate the slots virtually and save only the confirmed bookings?
fmeringdal · 5 years ago
May I ask you why you would want to store booking slots? I think the right approach is to recalculate available booking slots everytime (via the nettu-scheduler api) a customer asks for it. And then also store the confirmed booking timespan as a calendar event in nettu-scheduler so that the instructor will not be bookable again during that time. You can have a look at this example: https://github.com/fmeringdal/nettu-scheduler/blob/master/ex...
barhum · 5 years ago
Well, I was thinking of saving the booking slots presented to the customers for data purposes. Also, I was thinking that it might help to store the presented slots in case someone else books it before the person decides to reserve. This way eliminating the option in realtime might be easier and without having to recalculate all the remaining available slots again? But maybe there is a better solution to this....