Compare .date() when checking days between datetimes (badges.py)

This commit is contained in:
jesopo 2018-12-20 16:34:21 +00:00
parent 568eff01e0
commit 6d51473a73

View file

@ -12,7 +12,7 @@ class Module(ModuleManager.BaseModule):
return datetime.datetime.strptime(dt, DATETIME_FORMAT)
def _days_since(self, now: datetime.datetime, dt: datetime.datetime):
return (now-dt).days
return (now.date()-dt.date()).days
def _get_badges(self, user):
return user.get_setting("badges", {})