home
·
contact
·
privacy
projects
/
berlin-corona-table
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fca28d3
)
Add week day name display.
author
Christian Heller
<c.heller@plomlompom.de>
Sat, 4 Jul 2020 11:20:31 +0000
(13:20 +0200)
committer
Christian Heller
<c.heller@plomlompom.de>
Sat, 4 Jul 2020 11:20:31 +0000
(13:20 +0200)
enhance_table.py
patch
|
blob
|
history
diff --git
a/enhance_table.py
b/enhance_table.py
index 4a060a4b758a654ee5593662cf0f66386e037bf1..ab6ec46f071ce88484503007d163569759369eb1 100755
(executable)
--- 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.
db[district][date]['week_incidence'] = (week_sum / district_pop) * 100000
# Optimized for web browser viewing.
+import calendar
if output_type == 'html':
print("""<!DOCTYPE html>
<html>
if output_type == 'html':
print("""<!DOCTYPE html>
<html>
@@
-170,7
+171,8
@@
th { text-align: left; vertical-align: bottom; }
(translate[district], district))
print('</tr>')
print('<tr class="day_row">')
(translate[district], district))
print('</tr>')
print('<tr class="day_row">')
- print('<td>%s</td>' % date)
+ weekday = calendar.day_name[datetime.date.fromisoformat(date).weekday()]
+ print('<td>%s<br />(%s)</td>' % (date, weekday))
print('<td><table>')
for abbr in ['+', 'Σ', 'Ø', 'i']:
print('<tr><th><abbr title="%s">%s</abbr></th></tr>' %
print('<td><table>')
for abbr in ['+', 'Σ', 'Ø', 'i']:
print('<tr><th><abbr title="%s">%s</abbr></th></tr>' %
@@
-237,7
+239,8
@@
HTML view: https://plomlompom.com/berlin_corona.html"""
print('-'*77)
# Day table.
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 = []
new_infections = []
weekly_sums = []
weekly_avgs = []