mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-24 15:23:33 +01:00
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>
This commit is contained in:
parent
e8b990999f
commit
9c5c601439
1 changed files with 4 additions and 3 deletions
|
@ -113,10 +113,11 @@ func (l *Label) CalOpenIssues() {
|
||||||
|
|
||||||
// SetArchived set the label as archived
|
// SetArchived set the label as archived
|
||||||
func (l *Label) SetArchived(isArchived bool) {
|
func (l *Label) SetArchived(isArchived bool) {
|
||||||
if isArchived && l.ArchivedUnix.IsZero() {
|
if !isArchived {
|
||||||
l.ArchivedUnix = timeutil.TimeStampNow()
|
|
||||||
} else {
|
|
||||||
l.ArchivedUnix = timeutil.TimeStamp(0)
|
l.ArchivedUnix = timeutil.TimeStamp(0)
|
||||||
|
} else if isArchived && l.ArchivedUnix.IsZero() {
|
||||||
|
// Only change the date when it is newly archived.
|
||||||
|
l.ArchivedUnix = timeutil.TimeStampNow()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue