When re-enabling dynamic items, ensure the next_at date is from today, not from when it was last run

This commit is contained in:
Deon George 2024-12-01 16:15:07 +11:00
parent 33a97ce5b3
commit 445dd48c81

View File

@ -74,18 +74,27 @@ final class Dynamic extends Send
$this->do->next_at = $next_at $this->do->next_at = $next_at
->addDay(); ->addDay();
while ($this->do->next_at->isPast())
$this->do->next_at->addDay();
break; break;
case 'WEEKLY': case 'WEEKLY':
$this->do->next_at = $next_at $this->do->next_at = $next_at
->addWeek(); ->addWeek();
while ($this->do->next_at->isPast())
$this->do->next_at->addWeek();
break; break;
case 'MONTHLY': case 'MONTHLY':
$this->do->next_at = $next_at $this->do->next_at = $next_at
->addMonth(); ->addMonth();
while ($this->do->next_at->isPast())
$this->do->next_at->addMonth();
break; break;
default: default: