Localize milestone related time strings (#24051)
- With #23988 in place, we can improve these timestamps --------- Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
parent
8aada1849f
commit
97176754be
5 changed files with 5 additions and 10 deletions
|
@ -7,7 +7,6 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
|
@ -65,7 +64,6 @@ type Milestone struct {
|
|||
DeadlineString string `xorm:"-"`
|
||||
|
||||
TotalTrackedTime int64 `xorm:"-"`
|
||||
TimeSinceUpdate int64 `xorm:"-"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
@ -84,9 +82,6 @@ func (m *Milestone) BeforeUpdate() {
|
|||
// AfterLoad is invoked from XORM after setting the value of a field of
|
||||
// this object.
|
||||
func (m *Milestone) AfterLoad() {
|
||||
if !m.UpdatedUnix.IsZero() {
|
||||
m.TimeSinceUpdate = time.Now().Unix() - m.UpdatedUnix.AsTime().Unix()
|
||||
}
|
||||
m.NumOpenIssues = m.NumIssues - m.NumClosedIssues
|
||||
if m.DeadlineUnix.Year() == 9999 {
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue