diff --git a/backend/plan_processor.py b/backend/plan_processor.py index 24162891..324ff2f6 100644 --- a/backend/plan_processor.py +++ b/backend/plan_processor.py @@ -312,7 +312,7 @@ def update_forms(self): def update_rooms(self): self._logger.info("* Updating rooms...") - parsed_rooms: dict[str, dict] = {room: None for room in self.meta_extractor.rooms()} + parsed_rooms: dict[str, dict | None] = {room: None for room in self.meta_extractor.rooms()} try: room_parser = schools.room_parsers[str(self.school_number)] except KeyError: diff --git a/backend/vplan_utils.py b/backend/vplan_utils.py index 5fdd96ee..e4d15a17 100644 --- a/backend/vplan_utils.py +++ b/backend/vplan_utils.py @@ -10,17 +10,21 @@ _parse_form_pattern = re.compile( r"(?\d{1,2}(?!\d)|[A-Za-zÄÖÜäöüß]+(?![A-Za-zÄÖÜäöüß]))" - r"(?P[/.] |[^A-Za-zÄÖÜäöüß0-9() \n]?)" - r"(?P(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+?)(?:,(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+?))*)" - r"|(?P\d{1,2})" + r"(?P |[/._]|[^A-Za-zÄÖÜäöüß0-9() \n]?)(?:(?" + r"(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+\d{0,2})" + r"(?:,(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+\d{0,2}))*" + r")|(?P\d{1,2})" r")(?![^\s,:])" ) _loose_parse_form_pattern = re.compile( r"(?\d{1,2}(?!\d)|[A-Za-zÄÖÜäöüß]+(?![A-Za-zÄÖÜäöüß]))" - r"(?P[/.]? |[^A-Za-zÄÖÜäöüß0-9() \n]?)" - r"(?P(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+?)(?:,(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+?))*)" - r"|(?P\d{1,2})" + r"(?P |[/._]|[^A-Za-zÄÖÜäöüß0-9() \n]?)(?:(?" + r"(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+\d{0,2})" + r"(?:,(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+\d{0,2}))*" + r")|(?P\d{1,2})" r")(?![^\s,:()])" ) diff --git a/client/src/utils.js b/client/src/utils.js index 21a40c5d..3418d12d 100644 --- a/client/src/utils.js +++ b/client/src/utils.js @@ -356,7 +356,7 @@ export function format_date(date) { const monthIndex = date.getMonth(); const year = date.getFullYear(); - return `${weekday}., ${day}. ${months[monthIndex]} ${year}`; + return `${weekday}, ${day}. ${months[monthIndex]} ${year}`; } diff --git a/endpoints/api.py b/endpoints/api.py index 79f4dfab..d841142e 100644 --- a/endpoints/api.py +++ b/endpoints/api.py @@ -90,6 +90,7 @@ def plan(school_num: str) -> Response: "plans": json.loads(cache.get_plan_file(date, revision, "plans.json")), "exams": json.loads(cache.get_plan_file(date, revision, "exams.json")), "grouped_form_plans": json.loads(cache.get_plan_file(date, revision, "grouped_form_plans.json")), + "last_fetch": json.loads(cache.get_meta_file("last_fetch.json"))["timestamp"] } except FileNotFoundError: return send_error("Invalid date or revision.")