Fix compiler warnings

This commit is contained in:
Zed
2021-12-20 03:11:12 +01:00
parent f02515fda2
commit 7af71ec480
12 changed files with 21 additions and 23 deletions

View File

@@ -104,12 +104,9 @@ proc getTweetTime*(tweet: Tweet): string =
proc getShortTime*(tweet: Tweet): string =
let now = now()
var then = tweet.time.local()
then.utcOffset = 0
let since = now - tweet.time
let since = now - then
if now.year != then.year:
if now.year != tweet.time.year:
result = tweet.time.format("d MMM yyyy")
elif since.inDays >= 1:
result = tweet.time.format("MMM d")