Removing useable time slots from an array
<p>I'll ask my question in a moment first allow me to explain what I've done and am trying to accomplish.</p>

<p>Goal: Only show times that are available for a service to be booked on a muli-staff calendar.The import thing here is that services have minimum booking times (in minutes) </p>

<p>Approach:</p>

<p>Steps</p>

<p>1) Create an array of all possible times someone could start a booking (i.e, 9am-5pm where each key increase by a set interval (i.e, 5min,9:05, 9:10,etc)</p>

<p>2) Load each staffs bookings for that day into an array and intersect these arrays so you find out if at least one person is available at a certain time. </p>

<p>3) Generate an array that is the difference of available hours in the day with the result of the intersected staff bookings.</p>

<p>Where the problem lies...</p>

<p>If staff member "Mary" has a booking from 9:15 - 9:45 and John has an appointment from 9:00 - 9:30. It will show '9:00' as being available although it's only available from 9:00-9:15 .
Which doesn't work because in this case the minimum booking time is 30mins.</p>

<p>Question:</p>

<p>I have an array of hours: minutes at an set interval (5 mins). How do I remove blocks of time that are two short ?</p>
