Event calendar: Don't skip week if it is still sunday

This commit is contained in:
Raphael Michel
2024-01-29 12:47:43 +01:00
parent 9feea75bdb
commit fab29088e6

View File

@@ -654,7 +654,7 @@ def days_for_template(ebd, week, future_only=False):
'events': sorted(ebd.get(day), key=sort_ev) if day in ebd else [] 'events': sorted(ebd.get(day), key=sort_ev) if day in ebd else []
} }
for day in week.days() for day in week.days()
if not future_only or day > now().astimezone(get_current_timezone()).date() if not future_only or day >= now().astimezone(get_current_timezone()).date()
] ]
@@ -677,7 +677,7 @@ def weeks_for_template(ebd, year, month, future_only=False):
] ]
for week in calendar.monthcalendar(year, month) for week in calendar.monthcalendar(year, month)
if not future_only or ( if not future_only or (
any(day != 0 and date(year, month, day) > today for day in week) any(day != 0 and date(year, month, day) >= today for day in week)
) )
] ]