I'm trying to make an hour selection for a day. In some cases, there are already reservations for this day.
<ol id="selectable">
<li id="1" class="ui-widget-content">7:00</li>
<li id="1" class="ui-widget-content">8:00</li>
<li id="1" class="ui-widget-content">9:00</li>
<li id="1" class="ui-widget-content">10:00</li>
<li id="1" class="ui-widget-content">11:00</li>
<li id="1" class="ui-widget-content">12:00</li>
<li id="1" class="blocked">reserved</li>
<li id="1" class="blocked">reserved</li>
<li id="1" class="ui-widget-content">3:00</li>
</ol>
I already used a filter for blocked elements but it's still possible to continue selecting after a blocked element. The result would be an invalid reserveration because the reservations are overlapping.
For my example above: The item is already reserved between 1 and 2 PM, But I can still select from 11 AM to 3 PM.
I need something that stops (disables) the selection after passing a blocked element. For my example the result should be 11–12 o'clock.