Add driftkveld and hackekveld #27

Merged
felixalbrigtsen merged 1 commits from calendar-changes into master 2022-09-04 00:56:42 +02:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 0f8b15715b - Show all commits

View File

@ -27,8 +27,8 @@ 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\DriftkveldActivity, new \pvv\side\social\DriftkveldActivity,
new \pvv\side\DBActivity($pdo), new \pvv\side\DBActivity($pdo),
]); ]);

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') % 4 - 3) if ($date->format('W') % 4 - 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 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') % 4 - 3) if ($date->format('W') % 4 - 1)
return $this->prevDate($date->sub(new DateInterval('P7D'))); return $this->prevDate($date->sub(new DateInterval('P7D')));
return $date; return $date;
} }