From 287820464c41a9a2c788e9151fb9660eebf58874 Mon Sep 17 00:00:00 2001 From: Daniel Tsvetkov Date: Tue, 5 May 2020 15:51:47 +0200 Subject: [PATCH] fixes --- tww/lib.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tww/lib.py b/tww/lib.py index 5befb41..6c2cc2e 100644 --- a/tww/lib.py +++ b/tww/lib.py @@ -41,8 +41,11 @@ basepath = os.path.dirname(os.path.abspath(__file__)) SKIP_DATE_TOKENS = ['on', 'to', 'set', 'be'] -def parse_to_iso(dt): - parsed_dt = dateparser.parse(dt) +def parse_to_iso(dt, dt_hint=None): + if dt_hint: + parsed_dt = dateparser.parse(dt, date_formats=dt_hint) + else: + parsed_dt = dateparser.parse(dt) if parsed_dt: return parsed_dt.strftime(ISO_FORMAT)