Let's say I have an event that starts on 2014-05-20 09:00 and ends on 2014-05-20 17:00! What I want is to be able to split this event in two, say the break hours are 11:00 - 12:00 (which are stored as datetimes actually) and it would result into 4 datetimes:
2014-05-20 09:00 – 2014-05-20 11:00
2014-05-20 12:00 – 2014-05-20 17:00
I could have several break hours that split the event into many sub-events.
My idea is to sort the break hours datetimes and use the first break hour end time as the end start for the 1st subevent or vice versa depending when the break hour is. But there is a lot of calculation to be done here this way, isn't there a simpler way?