forked from boyska/sito-hackit-17
ICS: pure talk senza location
This commit is contained in:
parent
bb45bac62a
commit
16fa06f26d
1 changed files with 3 additions and 2 deletions
|
@ -315,7 +315,7 @@ def talks_to_ics():
|
||||||
|
|
||||||
|
|
||||||
def talk_to_ics(talk):
|
def talk_to_ics(talk):
|
||||||
if 'time' not in talk or 'duration' not in talk or 'room' not in talk:
|
if 'time' not in talk or 'duration' not in talk:
|
||||||
return ''
|
return ''
|
||||||
start = talk['time']
|
start = talk['time']
|
||||||
end = start + datetime.timedelta(minutes=talk['duration'])
|
end = start + datetime.timedelta(minutes=talk['duration'])
|
||||||
|
@ -331,7 +331,8 @@ def talk_to_ics(talk):
|
||||||
content += "DTEND:%s\n" % time.strftime('%Y%m%dT%H%M%SZ',
|
content += "DTEND:%s\n" % time.strftime('%Y%m%dT%H%M%SZ',
|
||||||
time.gmtime(float(
|
time.gmtime(float(
|
||||||
end.strftime('%s'))))
|
end.strftime('%s'))))
|
||||||
content += "LOCATION:%s\n" % talk['room']
|
|
||||||
|
content += "LOCATION:%s\n" % (talk['room'] if 'room' in talk else 'todo')
|
||||||
content += 'END:VEVENT\n'
|
content += 'END:VEVENT\n'
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue