From 699ec9aa88c33c1570dc5fa2f1a6ffd8ccfe5e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 21 Dec 2015 17:45:43 +0100 Subject: [PATCH] agenda: don't include occurences from other months in list view --- tabellio/agenda/folder.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tabellio/agenda/folder.py b/tabellio/agenda/folder.py index dbd0ccc..3a1f022 100644 --- a/tabellio/agenda/folder.py +++ b/tabellio/agenda/folder.py @@ -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