mirror of
https://github.com/ihabunek/toot.git
synced 2024-09-29 04:35:54 -04:00
Removed unneeded pareenthesis
This commit is contained in:
parent
3b67c85dfc
commit
ef2c35eaee
@ -37,19 +37,19 @@ def time_ago(value: datetime) -> datetime:
|
|||||||
now = datetime.now().astimezone()
|
now = datetime.now().astimezone()
|
||||||
delta = now.timestamp() - value.timestamp()
|
delta = now.timestamp() - value.timestamp()
|
||||||
|
|
||||||
if (delta < 1):
|
if delta < 1:
|
||||||
return "now"
|
return "now"
|
||||||
|
|
||||||
if (delta < 8 * DAY):
|
if delta < 8 * DAY:
|
||||||
if (delta < MINUTE):
|
if delta < MINUTE:
|
||||||
return f"{math.floor(delta / SECOND)}".rjust(2, " ") + "s"
|
return f"{math.floor(delta / SECOND)}".rjust(2, " ") + "s"
|
||||||
if (delta < HOUR):
|
if delta < HOUR:
|
||||||
return f"{math.floor(delta / MINUTE)}".rjust(2, " ") + "m"
|
return f"{math.floor(delta / MINUTE)}".rjust(2, " ") + "m"
|
||||||
if (delta < DAY):
|
if delta < DAY:
|
||||||
return f"{math.floor(delta / HOUR)}".rjust(2, " ") + "h"
|
return f"{math.floor(delta / HOUR)}".rjust(2, " ") + "h"
|
||||||
return f"{math.floor(delta / DAY)}".rjust(2, " ") + "d"
|
return f"{math.floor(delta / DAY)}".rjust(2, " ") + "d"
|
||||||
|
|
||||||
if (delta < 53 * WEEK): # not exactly correct but good enough as a boundary
|
if delta < 53 * WEEK: # not exactly correct but good enough as a boundary
|
||||||
return f"{math.floor(delta / WEEK)}".rjust(2, " ") + "w"
|
return f"{math.floor(delta / WEEK)}".rjust(2, " ") + "w"
|
||||||
|
|
||||||
return ">1y"
|
return ">1y"
|
||||||
|
Loading…
Reference in New Issue
Block a user