Greetings everyone!
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.
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 "[split] => true" 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 split == true in the foreach loop which prints out the events.
Here is an example array containing two simultaneous events:
$events = array(
array(
"id" => 21,
"start" => 1242219600,
"end" => 1242237600,
"title" => "foo",
"split" => false
),
array(
"id" => 22,
"start" => 1242223200,
"end" => 1242234000,
"title" => "foo",
"split" => false
)
);
$events = someFunctionToOffsetEvents($events);
How would you solve this one?
Thanks guys!