Cleanup code

This commit is contained in:
Yorin Anne De Jong 2017-10-07 16:41:50 +02:00
parent 8c8af74783
commit cd150d73c5
3 changed files with 12 additions and 11 deletions

View File

@ -1,9 +1,6 @@
<?php //declare(strict_types=1); <?php //declare(strict_types=1);
namespace pvv\side; namespace pvv\side;
use \pvv\side\social\NerdepitsaActivity;
use \pvv\side\social\AnimekveldActivity;
use \DateTimeImmutable; use \DateTimeImmutable;
use \DateInterval; use \DateInterval;
@ -74,7 +71,9 @@ class Agenda {
function($a) use ($startDate){ function($a) use ($startDate){
return $a->getNextEventFrom($startDate); return $a->getNextEventFrom($startDate);
}, $this->activities }, $this->activities
), function($a){return $a;}); ), function($a){
return isset($a);
});
usort($result, function($a, $b) { usort($result, function($a, $b) {
return ($a->getStart()->getTimeStamp() < $b->getStart()->getTimeStamp()) return ($a->getStart()->getTimeStamp() < $b->getStart()->getTimeStamp())
? -1 ? -1

View File

@ -20,7 +20,7 @@ class BrettspillEvent extends Event {
} }
public function getOrganiser() /* : User */ { public function getOrganiser() /* : User */ {
return "PVV"; return "Robert Maikher";
} }
public function getURL() /* : string */ { public function getURL() /* : string */ {

View File

@ -53,15 +53,15 @@ include '../inc/ticker.php';
<li> <li>
<a href="<?= htmlspecialchars($event->getURL()) ?>"><?= $event->getName(); ?></a> <a href="<?= htmlspecialchars($event->getURL()) ?>"><?= $event->getName(); ?></a>
<?php /* <a class="icon subscribe">+</a> */ ?> <?php /* <a class="icon subscribe">+</a> */ ?>
<?php if ($period) { <?php if ($period !== \pvv\side\Agenda::TODAY) {
if (\pvv\side\Agenda::isThisWeek($event->getStart()) || $event->getStart()->sub(new DateInterval('P3D'))->getTimestamp() < time()) { if (\pvv\side\Agenda::isThisWeek($event->getStart()) || $event->getStart()->sub(new DateInterval('P3D'))->getTimestamp() < time()) {
echo '<span class="time">' . strftime('%a', $event->getStart()->getTimestamp()) . '</span>'; echo '<span class="date">' . strftime('%a', $event->getStart()->getTimestamp()) . '</span>';
} else { } else {
echo '<span class="time">' . strftime('%e. %b', $event->getStart()->getTimestamp()) . '</span>'; echo '<span class="date">' . strftime('%e. %b', $event->getStart()->getTimestamp()) . '</span>';
} }
echo '<span class="date">' . $event->getStart()->format('H:i') . '</span>';
} else {
echo '<span class="time">' . $event->getStart()->format('H:i') . '</span>'; echo '<span class="time">' . $event->getStart()->format('H:i') . '</span>';
} else {
echo '<span class="date">' . $event->getStart()->format('H:i') . '</span>';
} }
?> ?>
</li> </li>
@ -76,7 +76,9 @@ include '../inc/ticker.php';
<p> <p>
Alle med tilknytning til NTNU kan bli medlem hos oss Alle med tilknytning til NTNU kan bli medlem hos oss
og benytte seg av våre ressurser. og benytte seg av våre ressurser.
<!--For å bli med i våre prosjekter og komitéer du søke.--> <!--
For å bli med i våre prosjekter og komitéer du søke.
-->
</p> </p>
<p> <p>
<a class="btn" href="paamelding/">Bli medlem</a> <a class="btn" href="paamelding/">Bli medlem</a>