aboutsummaryrefslogblamecommitdiffstats
path: root/bug/comment.go
blob: 0b4fd6ad388b0b6e58f964836549f8333c18be1e (plain) (tree)
1
2
3
4
5
6
7
8
9

           
        
                                             


                                       
 
                     

                      
                           


                                                                                                                    
                      
 

                                      

                                     
 
package bug

import (
	"github.com/MichaelMure/git-bug/util"
	"github.com/dustin/go-humanize"
	"time"
)

type Comment struct {
	Author  Person
	Message string
	Files   []util.Hash

	// 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
}

func (c Comment) FormatTime() string {
	t := time.Unix(c.UnixTime, 0)
	return humanize.Time(t)
}