From 0accf350b2ca79eb93659266e554da48e7814285 Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Fri, 15 Mar 2024 23:14:55 +0100 Subject: [PATCH] Natively support the %m/%Y and %m-%Y date formats --- src/common/dates.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/dates.py b/src/common/dates.py index 8410b0d5..3e96b156 100644 --- a/src/common/dates.py +++ b/src/common/dates.py @@ -23,6 +23,8 @@ def parse_month_year_date(text: str, formats: list[str] = frozenset([ "%B %Y", # January 2020 "%b %Y", # Jan 2020 "%Y-%m", # 2020-01 + "%m-%Y", # 01-2020 + "%m/%Y", # 01/2020 ])) -> datetime: """Parse a given text representing a partial date using a list of formats, adjusting it to the last day of the month.