From 9614bb1b9fc26eb19e46d2dd6c108c9710c7545d Mon Sep 17 00:00:00 2001 From: 6543 <24977596+6543@users.noreply.github.com> Date: Tue, 29 Oct 2019 06:24:24 +0100 Subject: [PATCH] [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! --- models/issue_milestone.go | 5 +++++ 1 file changed, 5 insertions(+) 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 }