pass seconds again, can not emit datetime from backend

This commit is contained in:
silverwind
2024-04-29 22:46:14 +02:00
parent cfee93d481
commit 5079641d1a
3 changed files with 12 additions and 27 deletions
+2 -3
View File
@@ -6,7 +6,6 @@ package repo
import (
"net/http"
"strings"
"time"
"code.gitea.io/gitea/models/db"
issues_model "code.gitea.io/gitea/models/issues"
@@ -101,7 +100,7 @@ func GetActiveStopwatch(ctx *context.Context) {
issue.Link(),
issue.Repo.FullName(),
issue.Index,
time.Unix(time.Now().Unix() - sw.Seconds(), 0).Format(time.RFC3339),
sw.Seconds() + 1, // ensure time is never zero in ui
}
}
@@ -110,5 +109,5 @@ type StopwatchTmplInfo struct {
IssueLink string
RepoSlug string
IssueIndex int64
Datetime string
Seconds int64
}