From aab3a04d0c4ddbf97d589ba9048a539c6d7186e9 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Thu, 25 Jun 2020 23:18:17 +0200 Subject: bug: harmonize how time are used, fix some issues in command special formats This assume that the convertion from time.Time <--> Unix timestamp is lossless which seems to be. --- bug/snapshot.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'bug/snapshot.go') diff --git a/bug/snapshot.go b/bug/snapshot.go index 39366c6d..11df04b2 100644 --- a/bug/snapshot.go +++ b/bug/snapshot.go @@ -19,7 +19,7 @@ type Snapshot struct { Author identity.Interface Actors []identity.Interface Participants []identity.Interface - CreatedAt time.Time + CreateTime time.Time Timeline []TimelineItem @@ -32,7 +32,7 @@ func (snap *Snapshot) Id() entity.Id { } // Return the last time a bug was modified -func (snap *Snapshot) LastEditTime() time.Time { +func (snap *Snapshot) EditTime() time.Time { if len(snap.Operations) == 0 { return time.Unix(0, 0) } @@ -40,15 +40,6 @@ func (snap *Snapshot) LastEditTime() time.Time { return snap.Operations[len(snap.Operations)-1].Time() } -// Return the last timestamp a bug was modified -func (snap *Snapshot) LastEditUnix() int64 { - if len(snap.Operations) == 0 { - return 0 - } - - return snap.Operations[len(snap.Operations)-1].GetUnixTime() -} - // GetCreateMetadata return the creation metadata func (snap *Snapshot) GetCreateMetadata(key string) (string, bool) { return snap.Operations[0].GetMetadata(key) -- cgit