aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpuni9869 <80308335+puni9869@users.noreply.github.com>2023-08-23 15:42:20 +0530
committerGitHub <noreply@github.com>2023-08-23 10:12:20 +0000
commit9c5c60143975a120bf70ac4aed34bf903ef19db6 (patch)
tree3be86cce3d9a6212324a91832feedd72bf8e8342
parente8b990999f89535269d20983079a40a0a9488eff (diff)
downloadgitea-9c5c60143975a120bf70ac4aed34bf903ef19db6.tar.gz
gitea-9c5c60143975a120bf70ac4aed34bf903ef19db6.zip
Fix archived unix time when archiving the label (#26681)
Small Fix :-`ArchivedUnix` column changed only change the date when it is newly archived. Co-authored-by: Giteabot <teabot@gitea.io>
-rw-r--r--models/issues/label.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/models/issues/label.go b/models/issues/label.go
index 70906efb47..0087c933a6 100644
--- a/models/issues/label.go
+++ b/models/issues/label.go
@@ -113,10 +113,11 @@ func (l *Label) CalOpenIssues() {
// SetArchived set the label as archived
func (l *Label) SetArchived(isArchived bool) {
- if isArchived && l.ArchivedUnix.IsZero() {
- l.ArchivedUnix = timeutil.TimeStampNow()
- } else {
+ if !isArchived {
l.ArchivedUnix = timeutil.TimeStamp(0)
+ } else if isArchived && l.ArchivedUnix.IsZero() {
+ // Only change the date when it is newly archived.
+ l.ArchivedUnix = timeutil.TimeStampNow()
}
}