Skip to content

Commit

Permalink
Merge pull request #27 from tralezab/patch-1
Browse files Browse the repository at this point in the history
Fixes fridge displaying negative time deltas
  • Loading branch information
optimumtact authored Sep 9, 2021
2 parents ac3fc8f + 815b05d commit 00ab1ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fridge/fridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ async def current(self, ctx):
await ctx.send(f"You look up on the top of the fridge but there is only some {random.choice(self.fridge_trash)} up there.")
return
usurpation_isoformat = await self.config.guild(ctx.guild).fridgetime()
#convert to date object and then subtract it from another date object to get a timedelta object
usurpation_timedelta = datetime.date.fromisoformat(usurpation_isoformat) - datetime.datetime.now().date()
#convert to date object and then subtract it from another date object to get a timedelta object. must be now - date to get a positive delta value
usurpation_timedelta = datetime.datetime.now().date() - datetime.date.fromisoformat(usurpation_isoformat)
reign_blurb = ""
time_blurb = " They've been up there for "
if not usurpation_timedelta.days:
Expand Down

0 comments on commit 00ab1ac

Please sign in to comment.