changeset 4088:4325a0f13b0f

tools (common/date_utils): update date parsing regex: the regex `<timestamp> + 30 minutes` was not parsed correctly, this update should fix it.
author Goffi <goffi@goffi.org>
date Thu, 08 Jun 2023 21:27:12 +0200
parents f8284f994948
children e7ee611fc860
files libervia/backend/tools/common/date_utils.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/backend/tools/common/date_utils.py	Thu Jun 08 21:26:09 2023 +0200
+++ b/libervia/backend/tools/common/date_utils.py	Thu Jun 08 21:27:12 2023 +0200
@@ -37,7 +37,7 @@
 
 RELATIVE_RE = re.compile(
     r"\s*(?P<in>\bin\b)?"
-    r"(?P<date>[^+-].+[^\s+-])?\s*(?P<direction>[-+])?\s*"
+    r"(?P<date>[^+-][^+]+[^\s+-])?\s*(?P<direction>[-+])?\s*"
     r"\s*(?P<quantity>\d+)\s*"
     r"(?P<unit>(second|sec|s|minute|min|month|mo|m|hour|hr|h|day|d|week|w|year|yr|y))s?"
     r"(?P<ago>\s+ago)?\s*",