diff --git a/event_display.py b/event_display.py index 28ce4011cb0a9387d0dc20c37c2d1d0ee5a88108..360271a001b2b3e0ab870bce379d61690b5c4e95 100644 --- a/event_display.py +++ b/event_display.py @@ -12,7 +12,7 @@ import os url = 'https://portal.idiv.de/ssf/ical/basic.ics?bi=393&ui=1026&pd=171497477d81eb659bd832ffe26c8bfe39d65fc3&v=1' tz = 'Europe/Berlin' now = arrow.now(tz) -period = (now.floor('day'), now.replace(weeks=+2)) +period = (now.floor('day'), now.replace(weeks=+52)) c = Calendar(requests.get(url).text) @@ -24,7 +24,7 @@ for e in c.events: duration = e.end - e.begin # short, full day and multi day events display datetime differently if duration.days < 1: - event_date = (e.begin.format('DD.MM.YYYY HH:mm') + event_date = (e.begin.format('DD.MM.YYYY, HH:mm') + ' – ' + e.end.format('HH:mm')) elif duration.days == 1: @@ -34,8 +34,7 @@ for e in c.events: corrected_end_date = e.end.replace(days = - 1) event_date = (e.begin.format('DD.MM.YYYY') + ' – ' - + corrected_end_date.format('DD.MM.YYYY') - + ', all day') + + corrected_end_date.format('DD.MM.YYYY')) else: event_date = '' # create list of dictionaries for jinja2 template