aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_map/gen_map.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-10-01 13:12:56 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2023-10-01 13:12:56 +0200
commitbd19fee6508e43099181793d66c25bb690b4c77b (patch)
tree3b028169b0dbbb97f78505b26f9069b2ce0f9664 /scripts/gen_map/gen_map.py
parentb71b49bec6df4735af1fac733f8970cb296cbced (diff)
downloadunterricht-bd19fee6508e43099181793d66c25bb690b4c77b.tar.gz
unterricht-bd19fee6508e43099181793d66c25bb690b4c77b.zip
fix default year
If we are in the first part of the school year after the big holidays in august use the current year. If we are in the second half we must use the year when the school started with is the current year minus 1.
Diffstat (limited to 'scripts/gen_map/gen_map.py')
-rwxr-xr-xscripts/gen_map/gen_map.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/gen_map/gen_map.py b/scripts/gen_map/gen_map.py
index 8b3ebc0f..90b848af 100755
--- a/scripts/gen_map/gen_map.py
+++ b/scripts/gen_map/gen_map.py
@@ -67,7 +67,7 @@ def die(msg: str, status=1):
def default_year() -> int:
"""return the default year"""
now = datetime.now()
- return now.year if now.month < 8 else now.year + 1
+ return now.year if now.month < 8 else now.year - 1
def get_holidays(land: int, year: int) -> list[icalevents.icalparser.Event]: