From 29f0afa31fda0e0a6a6ef66025e1beaccfb7fe78 Mon Sep 17 00:00:00 2001 From: helliio Date: Fri, 19 Aug 2016 23:46:30 +0200 Subject: [PATCH] added brettspillkvled event --- src/pvv/side/social/animekveldactivity.php | 4 +- src/pvv/side/social/animekveldevent.php | 4 +- src/pvv/side/social/brettspillactivity.php | 48 ++++++++++++++++++++++ src/pvv/side/social/brettspillevent.php | 26 ++++++++++++ www/index.php | 1 + www/sosiale/index.html | 15 ++++--- 6 files changed, 88 insertions(+), 10 deletions(-) create mode 100644 src/pvv/side/social/brettspillactivity.php create mode 100644 src/pvv/side/social/brettspillevent.php diff --git a/src/pvv/side/social/animekveldactivity.php b/src/pvv/side/social/animekveldactivity.php index 89ca88c..3f2f590 100644 --- a/src/pvv/side/social/animekveldactivity.php +++ b/src/pvv/side/social/animekveldactivity.php @@ -38,11 +38,11 @@ class AnimekveldActivity implements RepeatingActivity { } public function getLocation() /* : Location */ { - return "Peppes Kjøpmansgata"; + return "Koserommet"; } public function getOrganiser() /* : User */ { - return "Anders Christensen"; + return "Liang Zhu"; } } diff --git a/src/pvv/side/social/animekveldevent.php b/src/pvv/side/social/animekveldevent.php index f8ad6d8..f9dd0ba 100644 --- a/src/pvv/side/social/animekveldevent.php +++ b/src/pvv/side/social/animekveldevent.php @@ -16,11 +16,11 @@ class AnimekveldEvent extends Event { } public function getLocation() /* : Location */ { - return "Peppes Kjøpmansgata"; + return "Koserommet"; } public function getOrganiser() /* : User */ { - return "Anders Christensen"; + return "Liang Zhu"; } } diff --git a/src/pvv/side/social/brettspillactivity.php b/src/pvv/side/social/brettspillactivity.php new file mode 100644 index 0000000..19a31f3 --- /dev/null +++ b/src/pvv/side/social/brettspillactivity.php @@ -0,0 +1,48 @@ +format('H') > 20 || $date->format('H') == 19 && $date->format('i') > 30) + return $this->nextDate($date->add(new DateInterval('P1D'))->setTime(19, 30, 0)); + $date = $date->setTime(19, 30, 0); + if ($date->format('N') != 4) + return $this->nextDate($date->add(new DateInterval('P1D'))); + return $date; + } + + public function prevDate(DateTimeImmutable $date) { + if ($date->format('H') < 19 || $date->format('H') == 20 && $date->format('i') < 30) + return $this->prevDate($date->sub(new DateInterval('P1D'))->setTime(19, 30, 0)); + $date = $date->setTime(19, 30, 0); + if ($date->format('N') != 4) + return $this->prevDate($date->sub(new DateInterval('P1D'))); + return $date; + } + + public function getNextEventFrom(DateTimeImmutable $date) /* : Event */ { + return new BrettspillEvent($this->nextDate($date)); + } + + public function getPreviousEventFrom(DateTimeImmutable $date) /* : Event */ { + return new BrettspillEvent($this->prevDate($date)); + } + + public function getName() /* : string */ { + return "Brettspillkveld"; + } + + public function getLocation() /* : Location */ { + return "Koserommet"; + } + + public function getOrganiser() /* : User */ { + return "PVV"; + } + +} diff --git a/src/pvv/side/social/brettspillevent.php b/src/pvv/side/social/brettspillevent.php new file mode 100644 index 0000000..a9bd58d --- /dev/null +++ b/src/pvv/side/social/brettspillevent.php @@ -0,0 +1,26 @@ +getStart()->add(new DateInterval('PT4H1800S')); + } + + public function getName() /* : string */ { + return "Brettspillkveld"; + } + + public function getLocation() /* : Location */ { + return "Koserommet"; + } + + public function getOrganiser() /* : User */ { + return "PVV"; + } + +} diff --git a/www/index.php b/www/index.php index 24acd2a..370bc3b 100644 --- a/www/index.php +++ b/www/index.php @@ -8,6 +8,7 @@ $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $agenda = new \pvv\side\Agenda([ new \pvv\side\social\NerdepitsaActivity, new \pvv\side\social\AnimekveldActivity, + new \pvv\side\social\BrettspillActivity, new \pvv\side\DBActivity($pdo), ]); ?> diff --git a/www/sosiale/index.html b/www/sosiale/index.html index 563720a..3ffe77b 100644 --- a/www/sosiale/index.html +++ b/www/sosiale/index.html @@ -46,18 +46,21 @@

Vår samling

+

* Vi har flere ekspansjon til spillet +

** Vi har flere varianter av spillet

Påminn meg