forked from NYANDEV/forgejo
* [Fix] milestone close timestamp (#8728) * BugFix: Update closed_date_unix colum on milestone table on close * use go standart time lib * make backport work!
This commit is contained in:
parent
b2c3a7d79f
commit
9614bb1b9f
1 changed files with 5 additions and 0 deletions
|
@ -6,6 +6,7 @@ package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
@ -290,6 +291,10 @@ func ChangeMilestoneStatus(m *Milestone, isClosed bool) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
m.IsClosed = isClosed
|
m.IsClosed = isClosed
|
||||||
|
if isClosed {
|
||||||
|
m.ClosedDateUnix = util.TimeStamp(time.Now().Unix())
|
||||||
|
}
|
||||||
|
|
||||||
if err = updateMilestone(sess, m); err != nil {
|
if err = updateMilestone(sess, m); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue