From 1ab7903a19939a0b1d7b2dc27720e421e27c9c25 Mon Sep 17 00:00:00 2001 From: HanseGucker <joniweth@gmx.de> Date: Sun, 4 Nov 2018 13:47:52 +0100 Subject: [PATCH] Correct date in PDF (skip weekend) | Tidy up [TIMETABLE/SUBSTITUTIONS] --- biscuit/apps/chronos/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/biscuit/apps/chronos/views.py b/biscuit/apps/chronos/views.py index f8920113..5909aac4 100755 --- a/biscuit/apps/chronos/views.py +++ b/biscuit/apps/chronos/views.py @@ -71,7 +71,11 @@ def get_next_weekday(date): """Get the next weekday by a datetime object""" if date.isoweekday() in {6, 7}: - date += datetime.timedelta(days=date.isoweekday() % 4) + if date.isoweekday() == 6: + plus = 2 + else: + plus = 1 + date += datetime.timedelta(days=plus) return date -- GitLab