Support for commas

This commit is contained in:
ivdv 2023-09-29 12:12:55 -07:00
parent 25662d7bda
commit f9713e7ee0
Signed by: ivdv
GPG Key ID: 47917E8659809E1E

View File

@ -9,9 +9,10 @@ DAYS_EN = ["MON ", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
def load_events(csv_path:str) -> list[dict]: def load_events(csv_path:str) -> list[dict]:
events = [] events = []
with open(csv_path) as csv_file: with open(csv_path) as csv_file:
csv_reader = csv.reader(csv_file) csv_reader = csv.reader(csv_file, skipinitialspace=True)
next(csv_reader, None) next(csv_reader, None)
for event in csv_reader: for event in csv_reader:
print(event)
event_date = event[0] event_date = event[0]
event_date_parsed = datetime.strptime(event_date, "%d-%m-%Y").date() event_date_parsed = datetime.strptime(event_date, "%d-%m-%Y").date()
event_time = event[1] event_time = event[1]