aboutsummaryrefslogtreecommitdiffstats
path: root/bug
diff options
context:
space:
mode:
Diffstat (limited to 'bug')
-rw-r--r--bug/comment.go9
-rw-r--r--bug/person.go4
2 files changed, 11 insertions, 2 deletions
diff --git a/bug/comment.go b/bug/comment.go
index 72eed1a0..c7168275 100644
--- a/bug/comment.go
+++ b/bug/comment.go
@@ -17,8 +17,13 @@ type Comment struct {
UnixTime int64
}
-// FormatTime format the UnixTime of the comment for human consumption
-func (c Comment) FormatTime() string {
+// FormatTimeRel format the UnixTime of the comment for human consumption
+func (c Comment) FormatTimeRel() string {
t := time.Unix(c.UnixTime, 0)
return humanize.Time(t)
}
+
+func (c Comment) FormatTime() string {
+ t := time.Unix(c.UnixTime, 0)
+ return t.Format("Mon Jan 2 15:04:05 2006 +0200")
+}
diff --git a/bug/person.go b/bug/person.go
index 9fa86804..ff4d4a70 100644
--- a/bug/person.go
+++ b/bug/person.go
@@ -63,3 +63,7 @@ func (p Person) Validate() error {
return nil
}
+
+func (p Person) String() string {
+ return fmt.Sprintf("%s <%s>", p.Name, p.Email)
+}