agenda: don't include occurences from other months in list view

This commit is contained in:
Frédéric Péters 2015-12-21 17:45:43 +01:00
parent 55e78c5324
commit 699ec9aa88
1 changed files with 5 additions and 0 deletions

View File

@ -134,11 +134,16 @@ class View(grok.View, utils.MonthlyView):
def getMonthEventsWithRepetition(self):
events = self.getMonthEvents()
year, month = self.getYearAndMonthToDisplay()
for event in events[:]:
if not event.multidays():
continue
if event.start.month != month:
events.remove(event)
repeated = event.end.toordinal()-event.start.toordinal()
for i in range(repeated):
if (event.start+datetime.timedelta(i+1)).month != month:
continue
# duplicate event with minimal infos
new_event = event.__class__()
new_event.id = event.id