From ecc9a92512c854244ce9997b4861666460319308 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 4 Jul 2020 13:20:31 +0200 Subject: [PATCH] Add week day name display. --- enhance_table.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/enhance_table.py b/enhance_table.py index 4a060a4..ab6ec46 100755 --- a/enhance_table.py +++ b/enhance_table.py @@ -134,6 +134,7 @@ for i in range(len(sorted_dates)): db[district][date]['week_incidence'] = (week_sum / district_pop) * 100000 # Optimized for web browser viewing. +import calendar if output_type == 'html': print(""" @@ -170,7 +171,8 @@ th { text-align: left; vertical-align: bottom; } (translate[district], district)) print('') print('') - print('%s' % date) + weekday = calendar.day_name[datetime.date.fromisoformat(date).weekday()] + print('%s
(%s)' % (date, weekday)) print('') for abbr in ['+', 'Σ', 'Ø', 'i']: print('' % @@ -237,7 +239,8 @@ HTML view: https://plomlompom.com/berlin_corona.html""" print('-'*77) # Day table. - print(date) + weekday = calendar.day_name[datetime.date.fromisoformat(date).weekday()] + print('%s (%s)' % (date, weekday)) new_infections = [] weekly_sums = [] weekly_avgs = [] -- 2.30.2
%s