diff --git a/plot.py b/plot.py index 156e753..3d8e2d4 100644 --- a/plot.py +++ b/plot.py @@ -209,9 +209,10 @@ def parse_rki(filename): # Stand aus offiziellen Angaben auslesen stand = rki_file['Erläuterung'].iloc[1][0] - stand_regex = re.compile('^Datenstand: (\d\d.\d\d.\d\d\d\d, \d?\d:\d\d) Uhr$') + stand_regex = re.compile('^Datenstand: (\d{2}.\d{2}.(\d{2}|\d{4}), \d{1,2}:\d{2}) Uhr$') m = stand_regex.match(stand) - stand_date = datetime.datetime.strptime(m.groups()[0], '%d.%m.%Y, %H:%M') + stand_date_part = m.groups()[0].replace('.21,', '.2021,') + stand_date = datetime.datetime.strptime(stand_date_part, '%d.%m.%Y, %H:%M') print_stand = stand_date.isoformat() return dates, start_of_reporting_date, data_first_vaccination, data_second_vaccination, stand_date, print_stand