Merge pull request #2004 from MycroftAI/feature/tweak-datetime-parse
Tweak English extract_datetime() parsingpull/2006/head
commit
d26650b143
|
@ -634,7 +634,6 @@ def extract_duration_en(text):
|
|||
not consumed in the parsing. The first value will
|
||||
be None if no duration is found. The text returned
|
||||
will have whitespace stripped from the ends.
|
||||
|
||||
"""
|
||||
if not text:
|
||||
return None
|
||||
|
@ -1276,7 +1275,8 @@ def extract_datetime_en(string, dateNow, default_time):
|
|||
((not daySpecified) or dayOffset < 1)):
|
||||
# ambiguous time, detect whether they mean this evening or
|
||||
# the next morning based on whether it has already passed
|
||||
if dateNow.hour < HH:
|
||||
if dateNow.hour < HH or (dateNow.hour == HH and
|
||||
dateNow.minute < MM):
|
||||
pass # No modification needed
|
||||
elif dateNow.hour < HH + 12:
|
||||
HH += 12
|
||||
|
|
Loading…
Reference in New Issue