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
->addDay();
while ($this->do->next_at->isPast())
$this->do->next_at->addDay();
break;
case 'WEEKLY':
$this->do->next_at = $next_at
->addWeek();
while ($this->do->next_at->isPast())
$this->do->next_at->addWeek();
break;
case 'MONTHLY':
$this->do->next_at = $next_at
->addMonth();
while ($this->do->next_at->isPast())
$this->do->next_at->addMonth();
break;
default: