Task:
I'm creating an event scheduler using jQuery UI. Events are of a certain length (in minutes) and they can be dragged into different days, each with their own maximum length (in minutes). In the example, each day's maximum length is 480 minutes, and no more than 480 minutes worth of "events" should be allowed to drop in.
Problem:
If the "event" will cause the "day" to exceed its maximum time length (based on the combined times of elements already dropped on it), that "day" should be disabled (no dropping allowed for this specific event).
As you can see from the demo, I can figure out the combined time of events for each day ("minutes available" is updated on drag stop), but I don't know how to disable dropping into the day if the event being dragged would cause "minutes available" to go negative.