mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-18 18:55:49 +00:00
adds new logic to categorize dates function to help with filters
This commit is contained in:
@@ -8,10 +8,11 @@ def categorize_dates(arr):
|
||||
for obj in arr:
|
||||
end_date = datetime.strptime(obj['end_date'], '%B %d, %Y')
|
||||
if end_date < today:
|
||||
obj['type'] = obj['type'] + '-past'
|
||||
past.append(obj)
|
||||
else:
|
||||
obj['type'] = obj['type'] + '-upcoming'
|
||||
upcoming.append(obj)
|
||||
|
||||
return {'past': past, 'upcoming': upcoming}
|
||||
|
||||
export = {
|
||||
|
||||
Reference in New Issue
Block a user