From 68d06e2fd4f7283ccc1fbafd85b316d316ec36c9 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 2 Dec 2021 22:06:55 +0200 Subject: [PATCH] sdffsd --- files/classes/comment.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index a0c400106..9a0c3d758 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -129,9 +129,6 @@ class Comment(Base): @lazy def edited_string(self): - if not self.edited_utc: - return "never" - age = int(time.time()) - self.edited_utc if age < 60: @@ -148,12 +145,15 @@ class Comment(Base): now = time.gmtime() ctd = time.gmtime(self.edited_utc) + months = now.tm_mon - ctd.tm_mon + 12 * (now.tm_year - ctd.tm_year) + if now.tm_mday < ctd.tm_mday: + months -= 1 if months < 12: return f"{months}mo ago" else: - years = now.tm_year - ctd.tm_year + years = int(months / 12) return f"{years}yr ago" @property