aboutsummaryrefslogtreecommitdiffstats
path: root/bug/comment.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-30 11:10:03 +0200
committerGitHub <noreply@github.com>2018-09-30 11:10:03 +0200
commitd71bb7dd7632780cf5aad5fda84027fa03a9d0f0 (patch)
treedba6c3c0bab18f41e21cd36a9fe05d1d27a574d4 /bug/comment.go
parent8fdd6bf99c111c3756056e87ffd9209875ac5c1f (diff)
parentbad9cda969b49bf1bce6799056476ac4684892df (diff)
downloadgit-bug-d71bb7dd7632780cf5aad5fda84027fa03a9d0f0.tar.gz
Merge pull request #54 from MichaelMure/editablecomment
Core support for editable comments
Diffstat (limited to 'bug/comment.go')
-rw-r--r--bug/comment.go9
1 files changed, 3 insertions, 6 deletions
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")
}