Correct conditional that catches conflicts.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 21 Sep 2009 23:53:27 +0000 (19:53 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 29 Sep 2009 20:53:57 +0000 (16:53 -0400)
Allow the next event to start at the end time of the previous event.

kronolith/lib/Resource/Single.php

index 6e47f85..5b5c902 100644 (file)
@@ -57,8 +57,10 @@ class Kronolith_Resource_Single extends Kronolith_Resource_Base
                       $e->hasStatus(Kronolith::STATUS_FREE)) &&
                      $e->getUID() !== $uid) {
 
-                     if (!($e->start->compareDateTime($end) >= 1 ||
-                         $e->end->compareDateTime($start) <= -1)) {
+                     // Comparing to zero allows the events to start at the same
+                     // the previous event ends.
+                     if (!($e->start->compareDateTime($end) >= 0) &&
+                         !($e->end->compareDateTime($start) <= 0)) {
 
                         return false;
                      }