2018-07-12 13:44:46 +03:00
|
|
|
package bug
|
|
|
|
|
2018-07-19 19:10:45 +03:00
|
|
|
import (
|
|
|
|
"github.com/dustin/go-humanize"
|
|
|
|
"time"
|
|
|
|
)
|
2018-07-17 21:51:09 +03:00
|
|
|
|
2018-07-12 13:44:46 +03:00
|
|
|
type Comment struct {
|
2018-07-20 01:25:30 +03:00
|
|
|
Author Person `json:"author"`
|
|
|
|
Message string `json:"message"`
|
2018-07-14 23:18:40 +03:00
|
|
|
|
|
|
|
// 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.
|
2018-07-18 01:16:06 +03:00
|
|
|
UnixTime int64
|
2018-07-12 13:44:46 +03:00
|
|
|
}
|
2018-07-17 21:51:09 +03:00
|
|
|
|
|
|
|
func (c Comment) FormatTime() string {
|
2018-07-19 19:10:45 +03:00
|
|
|
t := time.Unix(c.UnixTime, 0)
|
|
|
|
return humanize.Time(t)
|
2018-07-17 21:51:09 +03:00
|
|
|
}
|