Added ability to provide detailed address in location field in calendar
This commit is contained in:
parent
a18a66f027
commit
075d9fcbc6
|
@ -72,7 +72,10 @@ def sync(calendar_url: str, event_collection_path: str) -> None:
|
||||||
end: datetime.datetime = event.end
|
end: datetime.datetime = event.end
|
||||||
end_str = end.isoformat(sep=' ')
|
end_str = end.isoformat(sep=' ')
|
||||||
event_content = event_content.replace('<end>', end_str)
|
event_content = event_content.replace('<end>', end_str)
|
||||||
event_content = event_content.replace('<location>', event.location)
|
location_info = event.location.split(sep=':')
|
||||||
|
event_content = event_content.replace('<location>', location_info[0])
|
||||||
|
if len(location_info) == 2:
|
||||||
|
event_content = event_content.replace('<address>', location_info[1])
|
||||||
|
|
||||||
event_filename = begin.date().isoformat() + '-' + event.name.replace(' ', '_') + '.markdown'
|
event_filename = begin.date().isoformat() + '-' + event.name.replace(' ', '_') + '.markdown'
|
||||||
with open(event_collection_path + event_filename, 'w', encoding='utf-8', newline='\n') as event_file:
|
with open(event_collection_path + event_filename, 'w', encoding='utf-8', newline='\n') as event_file:
|
||||||
|
|
|
@ -5,4 +5,5 @@ date: <date>
|
||||||
start_date: <begin>
|
start_date: <begin>
|
||||||
end_date: <end>
|
end_date: <end>
|
||||||
location: <location>
|
location: <location>
|
||||||
|
address: <address>
|
||||||
---
|
---
|
||||||
|
|
Loading…
Reference in New Issue