diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2025-01-21 06:49:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-21 06:49:58 +0800 |
commit | eef635523a8890ec6fb80eb2a67968d439f440ba (patch) | |
tree | d1cf73fc4bc1694ba3ecc25cb05353d433deeb9d /models | |
parent | 8f45a11919ca8abfa7fc0cc2ec8945d6746bba5a (diff) | |
download | gitea-eef635523a8890ec6fb80eb2a67968d439f440ba.tar.gz gitea-eef635523a8890ec6fb80eb2a67968d439f440ba.zip |
Make tracked time representation display as hours (#33315) (#33334)
Try to backport #33315, the only trivial conflict is in the helper
functions map in the helper.go
Fix #33333
Co-authored-by: Sysoev, Vladimir <i@vsysoev.ru>
Diffstat (limited to 'models')
-rw-r--r-- | models/issues/stopwatch.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/issues/stopwatch.go b/models/issues/stopwatch.go index 629af95b57..baffe04ace 100644 --- a/models/issues/stopwatch.go +++ b/models/issues/stopwatch.go @@ -48,7 +48,7 @@ func (s Stopwatch) Seconds() int64 { // Duration returns a human-readable duration string based on local server time func (s Stopwatch) Duration() string { - return util.SecToTime(s.Seconds()) + return util.SecToHours(s.Seconds()) } func getStopwatch(ctx context.Context, userID, issueID int64) (sw *Stopwatch, exists bool, err error) { @@ -201,7 +201,7 @@ func FinishIssueStopwatch(ctx context.Context, user *user_model.User, issue *Iss Doer: user, Issue: issue, Repo: issue.Repo, - Content: util.SecToTime(timediff), + Content: util.SecToHours(timediff), Type: CommentTypeStopTracking, TimeID: tt.ID, }); err != nil { |