mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-18 10:15:41 +00:00
feat: limit calendar past events
This commit is contained in:
parent
e7165a1487
commit
7bdb289461
@ -37,7 +37,7 @@ class DomainRefreshController extends AbstractController
|
|||||||
* @throws HttpExceptionInterface
|
* @throws HttpExceptionInterface
|
||||||
* @throws \Throwable
|
* @throws \Throwable
|
||||||
*/
|
*/
|
||||||
public function __invoke(string $ldhName, KernelInterface $kernel): ?Domain
|
public function __invoke(string $ldhName, KernelInterface $kernel): Domain
|
||||||
{
|
{
|
||||||
$idnDomain = strtolower(idn_to_ascii($ldhName));
|
$idnDomain = strtolower(idn_to_ascii($ldhName));
|
||||||
$userId = $this->getUser()->getUserIdentifier();
|
$userId = $this->getUser()->getUserIdentifier();
|
||||||
|
|||||||
@ -297,7 +297,7 @@ class WatchListController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @var DomainEvent $event */
|
/** @var DomainEvent $event */
|
||||||
foreach ($domain->getEvents()->toArray() as $event) {
|
foreach ($domain->getEvents()->filter(fn (DomainEvent $e) => $e->getDate()->diff(new \DateTimeImmutable('now'))->y <= 10)->getIterator() as $event) {
|
||||||
$calendar->addEvent((new Event())
|
$calendar->addEvent((new Event())
|
||||||
->setLastModified(new Timestamp($domain->getUpdatedAt()))
|
->setLastModified(new Timestamp($domain->getUpdatedAt()))
|
||||||
->setStatus(EventStatus::CONFIRMED())
|
->setStatus(EventStatus::CONFIRMED())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user