Skip to content

Commit

Permalink
hotfix ios parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
solumath committed Apr 29, 2023
1 parent 39ff9f2 commit 754e5ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cogs/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ def running_for(time):
minutes = now.minute - int(time[1])
return hours * 60 + minutes
else:
date = datetime.datetime.strptime(time[0], "%b%d")
try:
date = datetime.datetime.strptime(time[0], "%b%d")
except ValueError:
date = datetime.datetime.strptime(time[0], "%a%d")
date = date.replace(year=now.year, month=now.month)
minutes = (now - date.replace(year=now.year)).total_seconds() // 60
# subtracting a day as to assume it was ran right before midnight
return minutes - 1440
Expand Down

0 comments on commit 754e5ed

Please sign in to comment.