Skip to content

Commit

Permalink
utils.py: Drop unparseable dates
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed (ODSC) committed Oct 2, 2024
1 parent a169435 commit a29acd7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libcovebods/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def sort_by_date(list_with_date, index):
out = []
for item in list_with_date:
date = parse_date_field(item[index])
new_item = item.copy()
new_item[index] = date
out.append(new_item)
if date:
new_item = item.copy()
new_item[index] = date
out.append(new_item)
return sorted(out, key=lambda x: x[index])

0 comments on commit a29acd7

Please sign in to comment.