From 70b0981d8b2b7e0b518ea6d0d2c1dc5f4a79d615 Mon Sep 17 00:00:00 2001 From: hishizuka <12926652+hishizuka@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:09:35 +0900 Subject: [PATCH] bug fix --- modules/pyqt/menu/pyqt_course_menu_widget.py | 9 ++++++--- modules/utils/date.py | 7 ++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/pyqt/menu/pyqt_course_menu_widget.py b/modules/pyqt/menu/pyqt_course_menu_widget.py index 1a4a1401..5bd753d3 100644 --- a/modules/pyqt/menu/pyqt_course_menu_widget.py +++ b/modules/pyqt/menu/pyqt_course_menu_widget.py @@ -520,13 +520,16 @@ def draw_images(self, draw_map_image=True, draw_profile_image=True): return True - def set_font_size(self): - self.font_size = int(min(self.size().width(), self.size().height()) / 10) + def set_font_size(self, init=False): + if init: + self.font_size = int(min(self.config.display.resolution) / 10) + else: + self.font_size = int(min(self.size().width(), self.size().height()) / 10) def resizeEvent(self, event): self.check_all_image_and_draw() - self.set_font_size() + self.set_font_size(event.oldSize() == QtCore.QSize(-1, -1)) for i in [self.distance_item, self.ascent_item]: i.update_font_size(self.font_size) diff --git a/modules/utils/date.py b/modules/utils/date.py index 1aba3617..68ecd863 100644 --- a/modules/utils/date.py +++ b/modules/utils/date.py @@ -16,9 +16,10 @@ def datetime_myparser(ts): int(ts[12:14]), # %s ) return dt - elif 24 <= len(ts) <= 26: - # 2019-03-22T23:24:14.280604 / 26 chars - # 2019-09-30T12:44:55.000Z / 24 chars + elif 24 <= len(ts) <= 26 or len(ts) == 32: + # 2019-03-22T23:24:14.280604 / 26 chars + # 2019-09-30T12:44:55.000Z / 24 chars + # 2024-06-24 00:58:54.801928+00:00 / 32 chars dt = datetime( int(ts[0:4]), # %Y int(ts[5:7]), # %m