I am creating an bookings based website and I need help solving how to prevent bookings that are within the timeframe of another booking (from the same user). I don’t have a problem with different users choosing the same time to book a session. I have problem with the same user booking another session within the timeframe of the first booking. Like for example if a user books something for 1pm - 2pm, that same user shouldn’t be able to book anything in between 1pm - 2pm. They shouldn’t be able to book anything at 1:45pm. Sort of like what this website does below. When user book an session, the same user cannot book another session within the timeframe that another session is booked.
I am trying to duplicate the exact same functionality from the website below.
Just when creating available timeslots, add not only the professionals existing bookings, also add the bookers existing bookings. The result will be timeslots when both are available only
As you can see in the photos above, I am getting close to the solution, but I maybe getting something confused. I have been getting help from ChatGPT as well, although they may not be entirely accurate.
I know I’m getting close to the result I want, and the result I came up with seemed okay but it’s not functioning exactly like I want it as described by my first post.
Do you need it to work across time zones, like when the booker with existing bookings is in a different time zone than the professional?
Do you need to generate more than one potential timeslot when both are available?
Do you want to incorporate the normal availability schedule of the professional, so not just their existing bookings but also their availability like 9am - 3:30PM?
the conditions for start & end time here are mixed up; you want this time slot so start date should be >= and end date should be <=
looks like you changed them when you changed the workflow condition to count<1, but they were correct. keep the count condition and change the filter conditions.
I tried that as well and it only seems to be giving me half that functionality. My guess is there needs to be more constraints. But not sure what they are…
That is not what I am going for. This is not the traditional booking platform. This app won’t be using an availability schedule. Users will be booking meetings without an availability schedule. I am mimicking the scheduling functionality that these two websites are doing. Please refer back to my 1st post.
So you basically want to be able to say, I want to allow a new booking that starts at unix time a and ends at Unix time b that does not overlap any existing booking. So there cannot be any other booking in the system that has an end time in Unix or a begin time in Unix that is in between the booking window?
First you need to create this. Looking at your editor, this is not done yet, but based on the post, I’ll assume you already know how to do it and are in the process of putting it together…it is basically an availability schedule of the professional, which is a schedule of their available times to perform the session.
Once you create your functionality to allow a professional to create their events and the availability schedule for those events, then you need to create the booking functionality you asked about.
As per the site you reference you are trying to create, it doesn’t even have the functionality you are asking for. On my first attempt after signing up I was able to book a 60 minute session starting at 12PM on Dec 26th and then I booked a 12:30 PM session that is 60 minutes also starting Dec 26th.
So, if you are looking to just replicate the site booking functionality, don’t worry about double booking as the site you want to replicate doesn’t either and just let the user book a session whenever they want.
But to avoid a user from booking themselves into another event that overlaps an existing event they booked, create date ranges for the booked sessions of a user and then when the user wants to book another session that overlaps, get the date range of that session to see if any points overlap. There are operators for this, so check out bubble manual for operators and how to work with date ranges.