Add enddate to the event box.

Fixes #10
This commit is contained in:
Tim Schumacher 2014-08-31 13:42:52 +02:00
parent 6908eeebc9
commit befd59c2a7
2 changed files with 14 additions and 1 deletions

View file

@ -104,4 +104,17 @@ class Event extends BaseEntity
public function isValid() {
return true;
}
public function getFormatedDate() {
$retval = $this->startdate->format('Y-m-d H:i');
if (!is_null($this->enddate)) {
$retval .= "";
if ($this->startdate->format('Y-m-d') == $this->enddate->format('Y-m-d')) {
$retval .= $this->enddate->format('H:i');
} else {
$retval .= $this->enddate->format('Y-m-d H:i');
}
}
return $retval;
}
}

View file

@ -11,7 +11,7 @@
<p class="startdate ">
<i class="circular icon calendar green inverted link" title="Wann?"
data-content="Wann?"></i>{{ entity.startdate.format('Y-m-d H:i') }}
data-content="Wann?"></i>{{ entity.getFormatedDate() }}
</p>
{% if entity.location is not null %}