aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author65432019-10-29 06:24:24 +0100
committerLunny Xiao2019-10-29 13:24:24 +0800
commit9614bb1b9fc26eb19e46d2dd6c108c9710c7545d (patch)
treedb5fbca52e62aa1ff381f456426b7887b022030e
parentb2c3a7d79f87fb443ff2b479ce9c280f99262dbe (diff)
[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!
-rw-r--r--models/issue_milestone.go5
1 files changed, 5 insertions, 0 deletions
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
}