Re-enable recurring events for Fall 2023 (#48)

This commit is contained in:
Felix Albrigtsen 2023-09-02 21:25:07 +02:00 committed by GitHub
parent 850c8da95a
commit 133c4e269d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -27,9 +27,9 @@ use \pvv\side\Agenda;
$agenda = new \pvv\side\Agenda([ $agenda = new \pvv\side\Agenda([
// new \pvv\side\social\NerdepitsaActivity, // new \pvv\side\social\NerdepitsaActivity,
// new \pvv\side\social\AnimekveldActivity, // new \pvv\side\social\AnimekveldActivity,
// new \pvv\side\social\HackekveldActivity, new \pvv\side\social\HackekveldActivity,
// new \pvv\side\social\BrettspillActivity, new \pvv\side\social\BrettspillActivity,
// new \pvv\side\social\DriftkveldActivity, new \pvv\side\social\DriftkveldActivity,
new \pvv\side\DBActivity($pdo), new \pvv\side\DBActivity($pdo),
]); ]);

View File

@ -13,7 +13,7 @@ class BrettspillActivity implements Activity {
$date = $date->setTime(16, 15, 0); $date = $date->setTime(16, 15, 0);
if ($date->format('N') != 7) if ($date->format('N') != 7)
return $this->nextDate($date->add(new DateInterval('P1D'))); return $this->nextDate($date->add(new DateInterval('P1D')));
if ($date->format('W') % 2) if ($date->format('W') % 2 - 1)
return $this->nextDate($date->add(new DateInterval('P7D'))); return $this->nextDate($date->add(new DateInterval('P7D')));
return $date; return $date;
} }
@ -24,7 +24,7 @@ class BrettspillActivity implements Activity {
$date = $date->setTime(16, 15, 0); $date = $date->setTime(16, 15, 0);
if ($date->format('N') != 7) if ($date->format('N') != 7)
return $this->prevDate($date->sub(new DateInterval('P1D'))); return $this->prevDate($date->sub(new DateInterval('P1D')));
if ($date->format('W') % 2) if ($date->format('W') % 2 - 1)
return $this->prevDate($date->sub(new DateInterval('P7D'))); return $this->prevDate($date->sub(new DateInterval('P7D')));
return $date; return $date;

View File

@ -13,7 +13,7 @@ class DriftkveldActivity implements Activity {
$date = $date->setTime(18, 15, 0); $date = $date->setTime(18, 15, 0);
if ($date->format('N') != 6) if ($date->format('N') != 6)
return $this->nextDate($date->add(new DateInterval('P1D'))); return $this->nextDate($date->add(new DateInterval('P1D')));
if ($date->format('W') % 2) if ($date->format('W') % 2 - 1)
return $this->nextDate($date->add(new DateInterval('P7D'))); return $this->nextDate($date->add(new DateInterval('P7D')));
return $date; return $date;
} }
@ -24,7 +24,7 @@ class DriftkveldActivity implements Activity {
$date = $date->setTime(18, 15, 0); $date = $date->setTime(18, 15, 0);
if ($date->format('N') != 6) if ($date->format('N') != 6)
return $this->prevDate($date->sub(new DateInterval('P1D'))); return $this->prevDate($date->sub(new DateInterval('P1D')));
if ($date->format('W') % 2) if ($date->format('W') % 2 - 1)
return $this->prevDate($date->sub(new DateInterval('P7D'))); return $this->prevDate($date->sub(new DateInterval('P7D')));
return $date; return $date;
} }

View File

@ -13,7 +13,7 @@ class HackekveldActivity implements Activity {
$date = $date->setTime(16, 15, 0); $date = $date->setTime(16, 15, 0);
if ($date->format('N') != 6) if ($date->format('N') != 6)
return $this->nextDate($date->add(new DateInterval('P1D'))); return $this->nextDate($date->add(new DateInterval('P1D')));
if ($date->format('W') % 2 - 1) if ($date->format('W') % 2)
return $this->nextDate($date->add(new DateInterval('P7D'))); return $this->nextDate($date->add(new DateInterval('P7D')));
return $date; return $date;
} }
@ -24,7 +24,7 @@ class HackekveldActivity implements Activity {
$date = $date->setTime(18, 15, 0); $date = $date->setTime(18, 15, 0);
if ($date->format('N') != 6) if ($date->format('N') != 6)
return $this->prevDate($date->sub(new DateInterval('P1D'))); return $this->prevDate($date->sub(new DateInterval('P1D')));
if ($date->format('W') % 2 - 1) if ($date->format('W') % 2)
return $this->prevDate($date->sub(new DateInterval('P7D'))); return $this->prevDate($date->sub(new DateInterval('P7D')));
return $date; return $date;
} }