mirror of https://github.com/zulip/zulip.git
gcal-bot: Handle all-day events
(imported from commit 7395f2cdd2003b24ce59a1dbdf6f6ae24b6eae6c)
This commit is contained in:
parent
c9a555b605
commit
6ddbcf4799
|
@ -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 New Issue