Script help

Script help

I have a form for booking parties. The parties are available every Saturday and every Sunday. And each day has two slots available 11am-1pm or 2-4pm.

I am trying to find the best way to script this so that once someone books a slot it is no longer available.

At the moment I have two fields on the form
Field1 = Date selection (with only Saturday & Sunday set as allowed days)
Field2 = Dropdown field with the two timeslot options of 11am-1pm or 2-4pm.

On input of the Date field I would like the script to check if a timeslot is booked for that date and if so remove it from the dropdown list.

I have gotten as far as the below script but obviously this will just only consider if the timeslot has ever been booked and won't take into account the date. I don't know how to do it taking into account the date field. Any help would be greatly appreciated!

(clear Timeslots_Available;
original_timeslots_list = {"11am-1pm","2-4pm"};
available_timeslots_list = List();
for each  timeslot in original_timeslots_list
{
bookings_count = Parties[Timeslots_Available == timeslot].count();
if(bookings_count < 1)
{
available_timeslots_list.add(timeslot);
}
}
input.Timeslots_Available:ui.add(available_timeslots_list);