if (($overlap_array[($ol_start_date)][($compBlockKey)]["blockStart"] < $overlap_array[($ol_start_date)][($loopBlockKey)]["blockEnd"]) and ($overlap_array[($ol_start_date)][($compBlockKey)]["blockEnd"] > $overlap_array[($ol_start_date)][($loopBlockKey)]["blockStart"])) {
// define start and end of merged overlap block
if ($loopBlock["blockStart"] > $overlap_array[($ol_start_date)][($compBlockKey)]["blockStart"]) $overlap_array[($ol_start_date)][($loopBlockKey)]["blockStart"] = $overlap_array[($ol_start_date)][($compBlockKey)]["blockStart"];
if ($loopBlock["blockEnd"] < $overlap_array[($ol_start_date)][($compBlockKey)]["blockEnd"]) $overlap_array[($ol_start_date)][($loopBlockKey)]["blockEnd"] = $overlap_array[($ol_start_date)][($compBlockKey)]["blockEnd"];