mirror of https://gitlab.com/bashrc2/epicyon
List of lists
parent
6e101c17a1
commit
3e28ae1843
19
happening.py
19
happening.py
|
@ -232,20 +232,21 @@ def _event_text_match(content: str, text_match: str) -> bool:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def _sort_todays_events(events: []) -> []:
|
def _sort_todays_events(post_events_list: []) -> []:
|
||||||
"""Returns a list of events sorted in chronological order
|
"""Returns a list of events sorted in chronological order
|
||||||
"""
|
"""
|
||||||
events_dict = {}
|
events_dict = {}
|
||||||
|
|
||||||
# convert the list to a dict indexed on time
|
# convert the list to a dict indexed on time
|
||||||
for tag in events:
|
for post_event in post_events_list:
|
||||||
# only check events (not places)
|
for tag in post_event:
|
||||||
if tag['type'] != 'Event':
|
# only check events (not places)
|
||||||
continue
|
if tag['type'] != 'Event':
|
||||||
event_time = \
|
continue
|
||||||
datetime.strptime(tag['startTime'],
|
event_time = \
|
||||||
"%Y-%m-%dT%H:%M:%S%z")
|
datetime.strptime(tag['startTime'],
|
||||||
events_dict[event_time] = tag
|
"%Y-%m-%dT%H:%M:%S%z")
|
||||||
|
events_dict[event_time] = tag
|
||||||
|
|
||||||
# sort the dict
|
# sort the dict
|
||||||
new_events = []
|
new_events = []
|
||||||
|
|
Loading…
Reference in New Issue