1
0
Fork 0
forked from forgejo/forgejo

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*
This commit is contained in:
6543 2023-06-23 14:12:39 +02:00 committed by GitHub
parent a954c93a68
commit b0215c40cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 67 additions and 18 deletions

View file

@ -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