Added datepicker

This commit is contained in:
Dirk 2019-08-14 18:40:04 +02:00
parent f1cbba74c1
commit f51017325f
2 changed files with 14 additions and 4 deletions

View file

@ -90,11 +90,11 @@ class DateController extends ActionController
} }
if ($this->request->hasArgument('start') && $this->request->getArgument('start') != '') { if ($this->request->hasArgument('start') && $this->request->getArgument('start') != '') {
$start = date( "Y-m-d", strtotime( $this->request->getArgument('start'))); $start = date( "d.m.y", strtotime( $this->request->getArgument('start')));
} }
if ($this->request->hasArgument('end') && $this->request->getArgument('end') != '') { if ($this->request->hasArgument('end') && $this->request->getArgument('end') != '') {
$end = date( "Y-m-d", strtotime( $this->request->getArgument('end'))); $end = date( "d.m.y", strtotime( $this->request->getArgument('end')));
} }
$demand = $this->createDemandFromSearch(); $demand = $this->createDemandFromSearch();

View file

@ -18,13 +18,23 @@
<div class="col"> <div class="col">
<div class="form-group"> <div class="form-group">
<label for="start">Datum von</label> <label for="start">Datum von</label>
<f:form.textfield type="text" class="form-control" id="start" name="start" value="{start}" /> <div class="input-group date" id="date_start" data-target-input="nearest">
<f:form.textfield type="text" class="form-control datetimepicker-input" id="start" name="start" value="{start}" additionalAttributes="{data-target: '#date_start'}" />
<div class="input-group-append" data-target="#date_start" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="form-group"> <div class="form-group">
<label for="end">Datum bis</label> <label for="end">Datum bis</label>
<f:form.textfield type="text" class="form-control" id="end" name="end" value="{end}" /> <div class="input-group date" id="date_end" data-target-input="nearest">
<f:form.textfield type="text" class="form-control datetimepicker-input" id="start" name="end" value="{end}" additionalAttributes="{data-target: '#date_end'}" />
<div class="input-group-append" data-target="#date_end" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>