Skip to content

Commit

Permalink
fix date parts filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ashimali committed Nov 25, 2024
1 parent f6e88c6 commit d188e62
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions application/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@

def get_date_part(d_str, part):
parts = d_str.split("-")
if part == "YYYY":
if len(parts) == 1 and part == "YYYY":
return parts[0]
if part == "MM":
if len(parts) == 2 and part == "MM":
return parts[1]
return parts[2]
if len(parts) == 3 and part == "DD":
return parts[2]
return ""


def get_status_colour(status: Status) -> str:
Expand Down

0 comments on commit d188e62

Please sign in to comment.