From 735822ab746ca78366a170a6eb863ab1b2584b6b Mon Sep 17 00:00:00 2001 From: Goffi Date: Thu, 8 Jun 2023 21:27:12 +0200 Subject: [PATCH] tools (common/date_utils): update date parsing regex: the regex ` + 30 minutes` was not parsed correctly, this update should fix it. --- libervia/backend/tools/common/date_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libervia/backend/tools/common/date_utils.py b/libervia/backend/tools/common/date_utils.py index 26452421..5fd77d0b 100644 --- a/libervia/backend/tools/common/date_utils.py +++ b/libervia/backend/tools/common/date_utils.py @@ -37,7 +37,7 @@ from libervia.backend.core.i18n import _ RELATIVE_RE = re.compile( r"\s*(?P\bin\b)?" - r"(?P[^+-].+[^\s+-])?\s*(?P[-+])?\s*" + r"(?P[^+-][^+]+[^\s+-])?\s*(?P[-+])?\s*" r"\s*(?P\d+)\s*" r"(?P(second|sec|s|minute|min|month|mo|m|hour|hr|h|day|d|week|w|year|yr|y))s?" r"(?P\s+ago)?\s*",