aboutsummaryrefslogtreecommitdiffstats
path: root/bug/comment.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-17 20:51:09 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-17 20:51:09 +0200
commit43bf0063f2994463cdb98ec6420b786ca41dde28 (patch)
tree5a2c29ac37635d1cb6b020d7ce7f51849c42fc26 /bug/comment.go
parent1332a6ec0a00b2475bc2b7b35b4c61425361d6b6 (diff)
downloadgit-bug-43bf0063f2994463cdb98ec6420b786ca41dde28.tar.gz
crude implementation of show
Diffstat (limited to 'bug/comment.go')
-rw-r--r--bug/comment.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/bug/comment.go b/bug/comment.go
index 09cd49bd..8ea4154f 100644
--- a/bug/comment.go
+++ b/bug/comment.go
@@ -1,5 +1,7 @@
package bug
+import "time"
+
type Comment struct {
Author Person
Message string
@@ -8,3 +10,7 @@ type Comment struct {
// Should be used only for human display, never for ordering as we can't rely on it in a distributed system.
Time int64
}
+
+func (c Comment) FormatTime() string {
+ return time.Unix(c.Time, 0).Format(time.RFC822)
+}