[Backport] [Fix] milestone close timestamp (#8728) (#8731)

* [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:
6543 2019-10-29 06:24:24 +01:00 committed by Lunny Xiao
parent b2c3a7d79f
commit 9614bb1b9f
1 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,7 @@ package models
import (
"fmt"
"time"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
@ -290,6 +291,10 @@ func ChangeMilestoneStatus(m *Milestone, isClosed bool) (err error) {
}
m.IsClosed = isClosed
if isClosed {
m.ClosedDateUnix = util.TimeStamp(time.Now().Unix())
}
if err = updateMilestone(sess, m); err != nil {
return err
}