From 8e07d9dbeb6398211d34943ba2fe7a748b1fdcc1 Mon Sep 17 00:00:00 2001 From: emphasize Date: Fri, 26 May 2023 00:18:50 +0200 Subject: [PATCH] dont force ampm --- __init__.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/__init__.py b/__init__.py index 7323656b..f9f1b699 100644 --- a/__init__.py +++ b/__init__.py @@ -218,19 +218,16 @@ def get_display_current_time(self, location=None, dtUTC=None): use_24hour=self.use_24hour) def get_spoken_current_time(self, location=None, - dtUTC=None, force_ampm=False): + dtUTC=None): # Get a formatted spoken time based on the user preferences dt = self.get_local_datetime(location, dtUTC) if not dt: return - # speak AM/PM when talking about somewhere else - say_am_pm = bool(location) or force_ampm - s = nice_time(dt, self.lang, speech=True, - use_24hour=self.use_24hour, use_ampm=say_am_pm) + use_24hour=self.use_24hour, use_ampm=not self.use_24hour) # HACK: Mimic 2 has a bug with saying "AM". Work around it for now. - if say_am_pm: + if not self.use_24hour: s = s.replace("AM", "A.M.") return s @@ -402,7 +399,7 @@ def handle_query_future_time(self, message): return location = self._extract_location(utt) - future_time = self.get_spoken_current_time(location, dt, True) + future_time = self.get_spoken_current_time(location, dt) if not future_time: return