Skip to content

Commit

Permalink
Merge pull request #139 from junivex/bugfix/today-nonetype
Browse files Browse the repository at this point in the history
Correct handling of "today" to support foreign languages
  • Loading branch information
krisgesling authored Sep 23, 2020
2 parents 93bdd8c + ad3e7ee commit b1e003c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ def __handle_typed(self, message, response_type):
def __populate_report(self, message):
unit = self.__get_requested_unit(message)
# Get a date from requests like "weather for next Tuesday"
today, _ = self.__extract_datetime("today")
today, _ = self.__extract_datetime("today", lang='en')
when, _ = self.__extract_datetime(
message.data.get('utterance'), lang=self.lang)
when = when or today # Get todays date if None was found
Expand Down Expand Up @@ -1379,7 +1379,7 @@ def __populate_current(self, report, unit=None):

wind = self.get_wind_speed(forecastWeather)
report['wind'] = "{} {}".format(wind[0], wind[1] or "")
report['day'] = self.__to_day(extract_datetime('today')[0],
report['day'] = self.__to_day(self.__extract_datetime("today", lang='en')[0],
preface=True)

return report
Expand Down

0 comments on commit b1e003c

Please sign in to comment.