I have a form with the option to choose Date and Time. I am using the Datepicker and Timepicker components.
<!-- Date -->
<div class="col-xs-12 col-md-3 col-lg-3">
<div class="form-group">
<label>Data</label>
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input ng-model="alerta.data" type="text" class="form-control pull-right" id="dataHora">
</div>
</div>
</div>
<!-- Time -->
<div class="col-xs-12 col-md-3 col-lg-3">
<div class="form-group">
<label>Hora</label>
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-clock-o"></i>
</div>
<input ng-model="alerta.hora" type="text" class="form-control pull-right" id="timePicker">
</div>
</div>
</div>
The problem I'm having is the following, when I submit the form, I'm not getting the values alert.time and alert.data in my controller. The rest of the form inputs are usually received.
Follow JSON return:
This is the function that starts the two components:
vm.dateTimeRange = function() {
$('#dataHora').datepicker({timePicker: true, timePickerIncrement: 30, format: 'dd/mm/yyyy'});
$('#timePicker').timepicker();
}