I am building an app like airbnb for parking spot.
Right now I have set it up like this :
Database :
Parking spots
Bookings
When a booking is made, the booking gets a date range and the booking is added to the parking spot list of bookings
On the search page, users can input a date range, and the repeating group that displays the available spots excludes the parking spots that have bookings which dates ranges overlaps with the desired date range.
Now, I would like spot owners to be able to block certain timeslots (for example, every monday from 9am to 5pm)
Any idea how I could make it work ?
Right now I have it set up like this :
owner can input a blocked timeslot as a numeric range (so 9 am - 5pm is 540 - 1020)
And now the search page - if desired date range contains a monday - will be looking to exclude spots whose monday’s blocked numeric range overlaps with the range of the monday(s) in the search range
But this is way too complicated to replicate for every day of the week. I forces me to have multiple repeating groups on the page and load times are really slow.
Hi @thibautranger,
I have done something similar with your app before, and you can try this plugin. It’s really helpful! Let me know if you need assistance to achieve this function.
If you want to create custom options, you can separate them by creating some conditions.
Your data could be structured like this:
Booking
Booking Duration (Time, Days, Week, Month, Year)
Duration Length (number)
Start (datetime)
End (datetime)
On your UI, you can set conditions based on the booking duration. For example, if the booking duration is “Time,” it will show a time slot. If the booking duration is “Days,” “Week,” “Month,” or “Year,” it will show a date range.