aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
author6543 <m.huber@kithara.com>2023-06-23 14:12:39 +0200
committerGitHub <noreply@github.com>2023-06-23 12:12:39 +0000
commitb0215c40cdf9a3e46a45a3823b894998d1044cda (patch)
tree564ac8316c1cee99437879ba8594cbe786d04283 /modules
parenta954c93a68072042aa7dad717b6fa002c83a58fb (diff)
downloadgitea-b0215c40cdf9a3e46a45a3823b894998d1044cda.tar.gz
gitea-b0215c40cdf9a3e46a45a3823b894998d1044cda.zip
Store and use seconds for timeline time comments (#25392)
this will allow us to fully localize it later PS: we can not migrate back as the old value was a one-way conversion prepare for #25213 --- *Sponsored by Kithara Software GmbH*
Diffstat (limited to 'modules')
-rw-r--r--modules/util/sec_to_time.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/util/sec_to_time.go b/modules/util/sec_to_time.go
index 017ed45f8c..ad0fb1a68b 100644
--- a/modules/util/sec_to_time.go
+++ b/modules/util/sec_to_time.go
@@ -15,7 +15,9 @@ import (
// 1563418 -> 2 weeks 4 days
// 3937125s -> 1 month 2 weeks
// 45677465s -> 1 year 6 months
-func SecToTime(duration int64) string {
+func SecToTime(durationVal any) string {
+ duration, _ := ToInt64(durationVal)
+
formattedTime := ""
// The following four variables are calculated by taking