title: Calendar, offset overlapping events
body: <p>I am trying to write a calendar in PHP. In week view, I want my events to be listed like iCal, where simultaneous events reduces their width to half size.</p>
  
  <p>I have an extremely hard time figuring this one out though, so I hope you can help me. What I want is that if one event is overlapping another, it should set <code>[split] =&gt; true</code> on both event arrays - or something in that direction (read: I am unsure whether this is the most efficient solution). Then I can check for <code>split == true</code> in the foreach loop which prints out the events.</p>
  
  <p>Here is an example array containing two simultaneous events:</p>
  
  <pre><code>$events = array(
    array(
      "id" =&gt; 21,
      "start" =&gt; 1242219600,
      "end" =&gt; 1242237600,
      "title" =&gt; "foo",
      "split" =&gt; false
    ),
    array(
      "id" =&gt; 22,
      "start" =&gt; 1242223200,
      "end" =&gt; 1242234000,
      "title" =&gt; "foo",
      "split" =&gt; false
    )
  );
  
  $events = someFunctionToOffsetEvents($events);
  </code></pre>
  
  <p>How would you solve this one?</p>