summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-03-09 14:53:46 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-03-09 14:53:46 (GMT)
commit6f68887acae9fb817c59a707029f01562162e4aa (patch)
treec1bae271816d613e5194114950829aeb4427c01d
parentdd30a91f805242424e584b11c8d310cacdeae93e (diff)
downloadpykolab-6f68887acae9fb817c59a707029f01562162e4aa.tar.gz
Fix date conflict check (#4767)
-rw-r--r--pykolab/itip/__init__.py2
-rw-r--r--tests/unit/test-011-itip.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/pykolab/itip/__init__.py b/pykolab/itip/__init__.py
index 83c9fe1..eda4f04 100644
--- a/pykolab/itip/__init__.py
+++ b/pykolab/itip/__init__.py
@@ -234,7 +234,7 @@ def check_date_conflict(_es, _ee, _is, _ie):
elif _es == _is:
conflict = True
else: # _es > _is
- if _es <= _ie:
+ if _es < _ie:
conflict = True
else:
conflict = False
diff --git a/tests/unit/test-011-itip.py b/tests/unit/test-011-itip.py
index e47d314..08d9949 100644
--- a/tests/unit/test-011-itip.py
+++ b/tests/unit/test-011-itip.py
@@ -394,6 +394,7 @@ class TestITip(unittest.TestCase):
bstart = datetime.datetime(2014,7,13, 12,0,0)
bend = astart + datetime.timedelta(hours=1)
self.assertFalse(itip.check_date_conflict(astart, aend, bstart, bend))
+ self.assertFalse(itip.check_date_conflict(bstart, bend, astart, aend))
bstart = datetime.datetime(2014,6,13, 10,0,0)
bend = datetime.datetime(2014,6,14, 12,0,0)