Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
"today" in __populate_report should be passed with English (lang='en'), otherwise it is defined as None.
The same applies to "today" in ___populate_current, where self.__extract_datetime should be used with English as language.
  • Loading branch information
junivex authored Sep 18, 2020
1 parent 93bdd8c commit ad3e7ee
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 ad3e7ee

Please sign in to comment.