• !
    Do not create multiple accounts — you will be blocked. For rules, limits & more:
    Help
    Found a dead link? Report it to us. Report Link

How can I get an array of all overlapping date ranges across a given set

Codes MagicCodes Magic is verified member.

Administrator
Administrator
Moderator
Points 5,569
Solutions 0
Codes MagicCodes Magic is verified member.
Instead of walking through your full time range by hops of 30 mn, you just have to hop from event to event (an event being "the start or end of a booking").

Thus you'll have a timeline of all your bookings starts and ends sorted together, with a counter that makes +1 when it encounters a start date and -1 for an end date. When the counter reaches n, go for the red flag!
 

Be clear and specific: Instead of saying "it doesn't work" , provide details, logs, screenshots, or a description of the problem.

Back