summaryrefslogtreecommitdiffstats
path: root/pykolab/xml/event.py
diff options
context:
space:
mode:
Diffstat (limited to 'pykolab/xml/event.py')
-rw-r--r--pykolab/xml/event.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pykolab/xml/event.py b/pykolab/xml/event.py
index de9e4d9..8550714 100644
--- a/pykolab/xml/event.py
+++ b/pykolab/xml/event.py
@@ -419,7 +419,11 @@ class Event(object):
return self.get_created()
def get_ical_dtend(self):
- return self.get_end()
+ dtend = self.get_end()
+ # shift end by one day on all-day events
+ if not hasattr(dtend, 'hour'):
+ dtend = dtend + datetime.timedelta(days=1)
+ return dtend
def get_ical_dtstamp(self):
try:
@@ -632,6 +636,9 @@ class Event(object):
att = self.add_attendee(address, name=name, rsvp=rsvp, role=role, participant_status=partstat, cutype=cutype, params=params)
def set_ical_dtend(self, dtend):
+ # shift end by one day on all-day events
+ if not hasattr(dtend, 'hour'):
+ dtend = dtend - datetime.timedelta(days=1)
self.set_end(dtend)
def set_ical_dtstamp(self, dtstamp):