Added duration manipulation for multi-day events
This commit is contained in:
parent
fdc0197da1
commit
33a2e9b2fe
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue