1package bug
2
3import (
4 "github.com/MichaelMure/git-bug/util"
5 "github.com/dustin/go-humanize"
6 "time"
7)
8
9// Comment represent a comment in a Bug
10type Comment struct {
11 Author Person
12 Message string
13 Files []util.Hash
14
15 // Creation time of the comment.
16 // Should be used only for human display, never for ordering as we can't rely on it in a distributed system.
17 UnixTime int64
18}
19
20// FormatTime format the UnixTime of the comment for human consumption
21func (c Comment) FormatTime() string {
22 t := time.Unix(c.UnixTime, 0)
23 return humanize.Time(t)
24}