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

View File

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

View File

@ -53,15 +53,15 @@ include '../inc/ticker.php';
<li>
<a href="<?= htmlspecialchars($event->getURL()) ?>"><?= $event->getName(); ?></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()) {
echo '<span class="time">' . strftime('%a', $event->getStart()->getTimestamp()) . '</span>';
echo '<span class="date">' . strftime('%a', $event->getStart()->getTimestamp()) . '</span>';
} 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>';
} else {
echo '<span class="date">' . $event->getStart()->format('H:i') . '</span>';
}
?>
</li>
@ -76,7 +76,9 @@ include '../inc/ticker.php';
<p>
Alle med tilknytning til NTNU kan bli medlem hos oss
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>
<a class="btn" href="paamelding/">Bli medlem</a>