Fix endless loop in AnimekveldActivity.
This commit is contained in:
parent
6922cbeb23
commit
c18b49e992
|
@ -8,7 +8,7 @@ class AnimekveldActivity {
|
||||||
|
|
||||||
public function nextDate(DateTimeImmutable $date) {
|
public function nextDate(DateTimeImmutable $date) {
|
||||||
if ($date->format('H') > 20 || $date->format('H') == 19 && $date->format('i') > 30)
|
if ($date->format('H') > 20 || $date->format('H') == 19 && $date->format('i') > 30)
|
||||||
return $this->nextDate($date->add(new DateInterval('P1D')));
|
return $this->nextDate($date->add(new DateInterval('P1D'))->setTime(19, 30, 0));
|
||||||
$date = $date->setTime(19, 30, 0);
|
$date = $date->setTime(19, 30, 0);
|
||||||
if ($date->format('N') != 5)
|
if ($date->format('N') != 5)
|
||||||
return $this->nextDate($date->add(new DateInterval('P1D')));
|
return $this->nextDate($date->add(new DateInterval('P1D')));
|
||||||
|
@ -17,7 +17,7 @@ class AnimekveldActivity {
|
||||||
|
|
||||||
public function prevDate(DateTimeImmutable $date) {
|
public function prevDate(DateTimeImmutable $date) {
|
||||||
if ($date->format('H') < 19 || $date->format('H') == 20 && $date->format('i') < 30)
|
if ($date->format('H') < 19 || $date->format('H') == 20 && $date->format('i') < 30)
|
||||||
return $this->prevDate($date->sub(new DateInterval('P1D')));
|
return $this->prevDate($date->sub(new DateInterval('P1D'))->setTime(19, 30, 0));
|
||||||
$date = $date->setTime(19, 30, 0);
|
$date = $date->setTime(19, 30, 0);
|
||||||
if ($date->format('N') != 5)
|
if ($date->format('N') != 5)
|
||||||
return $this->prevDate($date->sub(new DateInterval('P1D')));
|
return $this->prevDate($date->sub(new DateInterval('P1D')));
|
||||||
|
|
Loading…
Reference in New Issue