summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/issue_tracked_time.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/models/issue_tracked_time.go b/models/issue_tracked_time.go
index b1c82b6207..3b2360f68f 100644
--- a/models/issue_tracked_time.go
+++ b/models/issue_tracked_time.go
@@ -7,6 +7,8 @@ package models
import (
"time"
+ api "code.gitea.io/sdk/gitea"
+
"github.com/go-xorm/builder"
)
@@ -25,6 +27,17 @@ func (t *TrackedTime) AfterLoad() {
t.Created = time.Unix(t.CreatedUnix, 0).Local()
}
+// APIFormat converts TrackedTime to API format
+func (t *TrackedTime) APIFormat() *api.TrackedTime {
+ return &api.TrackedTime{
+ ID: t.ID,
+ IssueID: t.IssueID,
+ UserID: t.UserID,
+ Time: t.Time,
+ Created: t.Created,
+ }
+}
+
// FindTrackedTimesOptions represent the filters for tracked times. If an ID is 0 it will be ignored.
type FindTrackedTimesOptions struct {
IssueID int64