hide expired projects in team-projects widget (#2432)

This commit is contained in:
Kevin Papst
2021-03-14 13:24:24 +01:00
committed by GitHub
parent ec0eca39ff
commit 0a6ea6be42
3 changed files with 43 additions and 1 deletions

View File

@@ -529,6 +529,21 @@ class Project implements EntityWithMetaFields
return $this->teams;
}
public function isVisibleAtDate(\DateTime $dateTime): bool
{
if (!$this->isVisible()) {
return false;
}
if ($this->getCustomer() !== null && !$this->getCustomer()->isVisible()) {
return false;
}
if ($this->getEnd() !== null && $dateTime > $this->getEnd()) {
return false;
}
return true;
}
/**
* @return string
*/