Skip to content

Commit

Permalink
revert changes to temp to reflect MycroftAI#180
Browse files Browse the repository at this point in the history
  • Loading branch information
emphasize committed Mar 29, 2021
1 parent 8a6d1d0 commit 85c6ae1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lingua_franca/lang/parse_de.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,13 +777,8 @@ def date_found():
datestr = datestr.replace(months[idx], en_month)
for idx, en_month in enumerate(en_monthsShort):
datestr = datestr.replace(monthsShort[idx], en_month)

try:
temp = datetime.strptime(datestr, "%B %d").replace(tzinfo=extractedDate.tzinfo)
except ValueError:
# Try again, allowing the year
temp = datetime.strptime(datestr, "%B %d %Y").replace(tzinfo=extractedDate.tzinfo)


temp = datetime.strptime(datestr, "%B %d")
if not hasYear:
temp = temp.replace(year=extractedDate.year)
if extractedDate < temp:
Expand Down

0 comments on commit 85c6ae1

Please sign in to comment.