From b3993d7b37a12e874f364fc69db5c3e5f5617c84 Mon Sep 17 00:00:00 2001 From: jeremiec Date: Thu, 9 Sep 2021 19:26:03 +0200 Subject: [PATCH 1/2] :bug: Fix empty days off --- timetracking.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/timetracking.py b/timetracking.py index 7b8b40e..f608409 100755 --- a/timetracking.py +++ b/timetracking.py @@ -114,7 +114,10 @@ def day_with_week( day, day.strftime("%Y-%m-%d"), day.strftime("%Y-%m-%d") in days_contributed, - all(day >= off_day["start"] and day <= off_day["end"] for off_day in off_days), + len(off_days) > 0 + and all( + day >= off_day["start"] and day <= off_day["end"] for off_day in off_days + ), ) From 031b6317882fccb12dc916ca45030cab5af8b481 Mon Sep 17 00:00:00 2001 From: jeremiec Date: Thu, 9 Sep 2021 19:26:22 +0200 Subject: [PATCH 2/2] :bug: fix weekly timetracking --- timetracking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timetracking.py b/timetracking.py index f608409..247d298 100755 --- a/timetracking.py +++ b/timetracking.py @@ -132,7 +132,7 @@ def getDaysOfThisWeek() -> Tuple[datetime.datetime, ...]: theday = datetime.datetime.today() weekday = theday.isoweekday() start = theday - datetime.timedelta(days=weekday - 1) - return (start + datetime.timedelta(days=d) for d in range(5)) + return tuple((start + datetime.timedelta(days=d) for d in range(5))) def getDaysOfThisMonth() -> Tuple[datetime.datetime, ...]: