Yeah basically what I am doing is:
Dispatch creates a booking with a start and end time. Bubble saves the date range in the background. It also adds that date range to the Pilot and the Aircraft selected in the booking.
Dispatch goes and makes another booking. Say they choose the same date/times as the previous booking. I don’t want to same Pilot and Aircraft to be available to choose, since they are no longer available as a booking was just made.
I was able to accomplish this by changing the visibility of the buttons representing the aircrafts/pilots based on whether that User or Aircraft has a booking time overlapping with the time Dispatch is choosing in the booking screen.
So it just turns the button invisible if that user has an overlapping booking.
What I’m trying to do now is see if I can use Bubble’s calendar plugin, along with it’s drag and resize features to update the bookings. I’m able to get it to update the Start and End times, but still trying to figure out how to use those events to update the booking date range. I thought the best way to do this would be to check if the booking’s built in “Date Modified” field has changed, then update the booking date range field, however there doesn’t seem to be a simple way to check this. I’m trying to save the modified date as a state on the calendar, then compare the modified date once I move or resize the booking, to the date saved in the state but that doesn’t seem to work.
There’s no option to just check if the modified date has changed and do something based on that.
I still intend on checking out your calendar plugin next week when I go on my days off.