commit
a2f17074be
9 changed files with 299 additions and 164 deletions
|
@ -204,6 +204,8 @@ class EventController extends Controller
|
|||
if (strlen($enddate) > 0) {
|
||||
$enddate = new \DateTime($enddate);
|
||||
$entity->enddate = $enddate;
|
||||
} else {
|
||||
$entity->enddate = null;
|
||||
}
|
||||
|
||||
$location = $request->get('location');
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 %}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
name="startdate"
|
||||
required="required"
|
||||
value="{{ entity.startdate.format('Y-m-d H:i')|default('') }}"
|
||||
placeholder="{{ "now"|date('d.m.Y H:i') }}"
|
||||
placeholder="{{ "now"|date('Y-m-d H:i') }}"
|
||||
class="form-control">
|
||||
|
||||
<i class="icon calendar"></i>
|
||||
|
@ -27,7 +27,7 @@
|
|||
id="event_enddate"
|
||||
name="enddate"
|
||||
value="{{ entity.enddate.format('Y-m-d H:i')|default('') }}"
|
||||
placeholder="{{ "now"|date('d.m.Y H:i') }}"
|
||||
placeholder="{{ "now"|date('Y-m-d H:i') }}"
|
||||
class="form-control">
|
||||
|
||||
<i class="icon calendar"></i>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<title>{% block title %}Terminverwaltung Calcifer{% endblock %}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!-- Bootstrap -->
|
||||
<link rel="shortcut icon" href="/favicon.png" />
|
||||
<link href='//fonts.googleapis.com/css?family=Roboto:400,700' rel='stylesheet' type='text/css'>
|
||||
{% stylesheets filter="compass"
|
||||
"@CalciferBundle/Resources/assets/css/main.scss"
|
||||
|
|
Reference in a new issue