Skip to content

Commit

Permalink
Do seconds ago for timeAgo
Browse files Browse the repository at this point in the history
  • Loading branch information
cyx committed Jan 26, 2021
1 parent 3571a4d commit c9fa65b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/display/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ func timeAgo(ts time.Time) string {

v := time.Since(ts)
switch {
case v < time.Minute:
return fmt.Sprintf("%d seconds ago", v/time.Second)

case v < 2*time.Minute:
return "a minute ago"

Expand Down

0 comments on commit c9fa65b

Please sign in to comment.