Skip to content

Commit

Permalink
Fix archived unix time when archiving the label (#26681)
Browse files Browse the repository at this point in the history
Small Fix :-`ArchivedUnix` column changed only change the date when it is newly archived.

Co-authored-by: Giteabot <teabot@gitea.io>
  • Loading branch information
puni9869 and GiteaBot authored Aug 23, 2023
1 parent e8b9909 commit 9c5c601
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions models/issues/label.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit 9c5c601

Please sign in to comment.