From 312489e94e19ed450ad0da6bcf6171fe31cde29c Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 18 Jul 2023 16:50:44 +0800 Subject: [PATCH] fixed bug where wrong weekday is showing for prof weather --- stockTicker.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/stockTicker.py b/stockTicker.py index fe530a9..b46bd58 100755 --- a/stockTicker.py +++ b/stockTicker.py @@ -5057,13 +5057,6 @@ class StockTicker(): f.close() locations = list(daily_weathers['locations'].keys()) - weekdays = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] - months =['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - month = months[int(datetime.now().strftime('%m'))-1] - date = str(int(datetime.now().strftime('%d'))) - - weekday = weekdays[datetime.today().weekday()] - for i, location in enumerate(locations): try: @@ -5093,7 +5086,12 @@ class StockTicker(): img.paste(location_img, (5,3)) x_offset = location_img.size[0] + 8 - + + weekdays = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] + months =['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + month = months[int(datetime.now().strftime('%m'))-1] + date = str(int(datetime.now().strftime('%d'))) + weekday = weekdays[datetime.today().weekday()] date_img = self.textImage((month + ' ' + date + ',' + weekday).upper(), font)