|
@@ -71,13 +71,17 @@ def events_calendar():
|
|
|
actions = tuple(model.get_actions_by_alarm(alarm))
|
|
|
if not actions:
|
|
|
continue
|
|
|
- t = datetime.fromtimestamp(int(today.strftime("%s")))
|
|
|
- occurrences = [
|
|
|
- t
|
|
|
- for t in timegenerate(alarm, now=t, howmany=max_occurrences + 1)
|
|
|
- if t is not None
|
|
|
- and t <= datetime.combine(today + timedelta(days=max_days), time())
|
|
|
- ]
|
|
|
+ today_dt = datetime.fromtimestamp(int(today.strftime("%s")))
|
|
|
+ max_dt = datetime.combine(today_dt + timedelta(days=max_days), time())
|
|
|
+ occurrences = []
|
|
|
+ for t in timegenerate(
|
|
|
+ alarm, now=today_dt, howmany=max_occurrences + 1
|
|
|
+ ):
|
|
|
+ if t is None:
|
|
|
+ break
|
|
|
+ if t > max_dt:
|
|
|
+ break
|
|
|
+ occurrences.append(t)
|
|
|
if not occurrences:
|
|
|
continue
|
|
|
if not show_all and len(occurrences) > max_occurrences:
|