diff --git a/models/issue_milestone.go b/models/issue_milestone.go index 6db488473..2fc54b067 100644 --- a/models/issue_milestone.go +++ b/models/issue_milestone.go @@ -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 }