From fb71d1be2fc64792fde55f98e3a8e2e3931f9e53 Mon Sep 17 00:00:00 2001 From: ppiro <68238658+ppiro@users.noreply.github.com> Date: Sat, 23 Sep 2023 12:17:43 +0200 Subject: [PATCH] refactor compute start and end day in advance to improve readability --- cal/views.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cal/views.py b/cal/views.py index d0734a2..00269ef 100644 --- a/cal/views.py +++ b/cal/views.py @@ -43,14 +43,17 @@ def formatday(self, day, weekday): .exclude(startDate__gt=next_day) .exclude(endDate__lt=this_day, endDate__isnull=False) .exclude(endDate__isnull=True, startDate__lt=this_day)): + start_day = event.startDate.date() + end_day = (event.endDate or event.startDate).date() + body.append('