Added duration manipulation for multi-day events

This commit is contained in:
Maximilian Giller 2019-04-09 10:48:34 +02:00
parent fdc0197da1
commit 33a2e9b2fe

View file

@ -58,11 +58,13 @@ class DayViewPanel (PanelDesign):
today = date.today() today = date.today()
tzinfo = event.end_datetime.tzinfo tzinfo = event.end_datetime.tzinfo
event.end_datetime = datetime(today.year, today.month, today.day, 0, 0, 0, 0, tzinfo) + timedelta(1) event.end_datetime = datetime(today.year, today.month, today.day, 0, 0, 0, 0, tzinfo) + timedelta(1)
event.duration = timedelta(0, 0, 0, 0, event.begin_datetime.minute, event.begin_datetime.hour)
timed_ev.append(event) timed_ev.append(event)
elif self.__is_today__(event.end_datetime): elif self.__is_today__(event.end_datetime):
today = date.today() today = date.today()
tzinfo = event.begin_datetime.tzinfo tzinfo = event.begin_datetime.tzinfo
event.begin_datetime = datetime(today.year, today.month, today.day, 0, 0, 0, 0, tzinfo) event.begin_datetime = datetime(today.year, today.month, today.day, 0, 0, 0, 0, tzinfo)
event.duration = timedelta(0, 0, 0, 0, event.end_datetime.minute, event.end_datetime.hour)
timed_ev.append(event) timed_ev.append(event)
else: else:
allday_ev.append(event) allday_ev.append(event)