I have a booking event schema with fields start_date and end_date.
I need to find available time slots for the specified date grouped by 30 minutes like in the screenshot.
So if we have the booked events with {start_date: "2022-11-18 18:00", end_date: "2022-11-18 19:00"} and {start_date: "2022-11-18 09:00", end_date: "2022-11-18 9:45"}
9:00, 9:30, 6:00 and 6:30 slots should not be available
Your date and time should use real date and time. With strings like you have you might need to implement all the nice date library like $dateToParts, $dateAdd. $dateDiff. And string are slower to compare, take more space to store and more bandwidth to transmit.
I am working on the same kind of website, where i have to book a room, only on working days and each day with 30 minute time period from 9 am to 9 pm. user can book any timeslot but reset should be bookable by other user. I am new developer. so its tough for me.