Skip to content

Commit

Permalink
Unify tweet date formatting, add UTC
Browse files Browse the repository at this point in the history
Closes zedeus#65
  • Loading branch information
zedeus committed Jan 3, 2022
1 parent bc352cd commit 80ebec3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/formatters.nim
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,11 @@ proc getJoinDateFull*(profile: Profile): string =
profile.joinDate.format("h:mm tt - d MMM YYYY")

proc getTime*(tweet: Tweet): string =
tweet.time.format("d/M/yyyy', 'HH:mm:ss")
tweet.time.format("h:mm tt' · 'MMM d', 'YYYY 'UTC'")

proc getRfc822Time*(tweet: Tweet): string =
tweet.time.format("ddd', 'dd MMM yyyy HH:mm:ss 'GMT'")

proc getTweetTime*(tweet: Tweet): string =
tweet.time.format("h:mm tt' · 'MMM d', 'YYYY")

proc getShortTime*(tweet: Tweet): string =
let now = now()
let since = now - tweet.time
Expand Down
2 changes: 1 addition & 1 deletion src/views/tweet.nim
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class=""; index=0;
renderQuote(tweet.quote.get(), prefs, path)

if mainTweet:
p(class="tweet-published"): text getTweetTime(tweet)
p(class="tweet-published"): text getTime(tweet)

if tweet.mediaTags.len > 0:
renderMediaTags(tweet.mediaTags)
Expand Down

0 comments on commit 80ebec3

Please sign in to comment.