Better alignment of date/time for today

This commit is contained in:
Yorin Anne De Jong 2017-10-07 16:58:27 +02:00
parent 0a2c08eb9b
commit faff3a2a8d
2 changed files with 2 additions and 3 deletions

View File

@ -33,7 +33,6 @@ img.float-right {
.calendar-events ul .time {
color: rgba(0,0,0,.5);
float: right;
width: 4em;
}
.calendar-events ul .icon, .calendar-events ul .date {
float: right;

View File

@ -54,14 +54,14 @@ include '../inc/ticker.php';
<a href="<?= htmlspecialchars($event->getURL()) ?>"><?= $event->getName(); ?></a>
<?php /* <a class="icon subscribe">+</a> */ ?>
<?php if ($period !== \pvv\side\Agenda::TODAY) {
echo '<span class="time">' . $event->getStart()->format('H:i') . '</span>';
if (\pvv\side\Agenda::isThisWeek($event->getStart()) || $event->getStart()->sub(new DateInterval('P3D'))->getTimestamp() < time()) {
echo '<span class="date">' . strftime('%a', $event->getStart()->getTimestamp()) . '</span>';
} else {
echo '<span class="date">' . strftime('%e. %b', $event->getStart()->getTimestamp()) . '</span>';
}
echo '<span class="time">' . $event->getStart()->format('H:i') . '</span>';
} else {
echo '<span class="date">' . $event->getStart()->format('H:i') . '</span>';
echo '<span class="time">' . $event->getStart()->format('H:i') . '</span>';
}
?>
</li>