comment.go

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