Commit e234f85b authored by Zach Osman's avatar Zach Osman
Browse files

adding datetime formatting for event date

parent cc9bfe38
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# third party imports # third party imports
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from datetime import datetime
import requests import requests
_MONTH_DICT = { _MONTH_DICT = {
...@@ -104,7 +105,8 @@ def filter_data_into_days(dictlist): ...@@ -104,7 +105,8 @@ def filter_data_into_days(dictlist):
if event_date in day_dict: if event_date in day_dict:
day_dict[event_date]["events"].append(event) day_dict[event_date]["events"].append(event)
else: else:
day_dict[event_date] = {"date": event_date, "events": [event]} _datetime = datetime(int(event["year"]), _MONTH_DICT[event["month"]], int(event["dayofmonth"]))
day_dict[event_date] = {"date": event_date, "datetime": _datetime.isoformat(' '), "events": [event]}
day_list = [] day_list = []
for day in day_dict: for day in day_dict:
day_list.append(day_dict[day]) day_list.append(day_dict[day])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment