From 037f5bf50b2bb2b020620413d186b6acf47a0b61 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 30 Sep 2018 11:00:39 +0200 Subject: timeline: various minor improvements --- bug/comment.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'bug/comment.go') diff --git a/bug/comment.go b/bug/comment.go index c7168275..db5cc45e 100644 --- a/bug/comment.go +++ b/bug/comment.go @@ -3,7 +3,6 @@ package bug import ( "github.com/MichaelMure/git-bug/util/git" "github.com/dustin/go-humanize" - "time" ) // Comment represent a comment in a Bug @@ -14,16 +13,14 @@ type Comment struct { // Creation time of the comment. // Should be used only for human display, never for ordering as we can't rely on it in a distributed system. - UnixTime int64 + UnixTime Timestamp } // FormatTimeRel format the UnixTime of the comment for human consumption func (c Comment) FormatTimeRel() string { - t := time.Unix(c.UnixTime, 0) - return humanize.Time(t) + return humanize.Time(c.UnixTime.Time()) } func (c Comment) FormatTime() string { - t := time.Unix(c.UnixTime, 0) - return t.Format("Mon Jan 2 15:04:05 2006 +0200") + return c.UnixTime.Time().Format("Mon Jan 2 15:04:05 2006 +0200") } -- cgit