fixed bug where wrong weekday is showing for prof weather

This commit is contained in:
Justin 2023-07-18 16:50:44 +08:00 committed by GitHub
parent 474881c2f1
commit 312489e94e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)