gcal-bot: Handle all-day events
(imported from commit 7395f2cdd2003b24ce59a1dbdf6f6ae24b6eae6c)
This commit is contained in:
parent
96cd0fc325
commit
9045ecae65
|
@ -93,7 +93,9 @@ def get_events():
|
|||
|
||||
for event in feed.entry:
|
||||
start = event.when[0].start.split('.')[0]
|
||||
start = datetime.datetime.strptime(start, '%Y-%m-%dT%H:%M:%S')
|
||||
# All-day events can have only a date
|
||||
fmt = '%Y-%m-%dT%H:%M:%S' if 'T' in start else '%Y-%m-%d'
|
||||
start = datetime.datetime.strptime(start, fmt)
|
||||
yield (event.uid.value, start, event.title.text)
|
||||
|
||||
# Our cached view of the calendar, updated periodically.
|
||||
|
|
Loading…
Reference in a new issue