This commit is contained in:
Daniel Tsvetkov 2020-05-05 15:51:47 +02:00
parent 83c1580726
commit 287820464c

View File

@ -41,8 +41,11 @@ basepath = os.path.dirname(os.path.abspath(__file__))
SKIP_DATE_TOKENS = ['on', 'to', 'set', 'be'] SKIP_DATE_TOKENS = ['on', 'to', 'set', 'be']
def parse_to_iso(dt): def parse_to_iso(dt, dt_hint=None):
parsed_dt = dateparser.parse(dt) if dt_hint:
parsed_dt = dateparser.parse(dt, date_formats=dt_hint)
else:
parsed_dt = dateparser.parse(dt)
if parsed_dt: if parsed_dt:
return parsed_dt.strftime(ISO_FORMAT) return parsed_dt.strftime(ISO_FORMAT)