I'm dealing with an issue with dates format:
in my formular I'm using uib-datepicker-popup to get the calendar and in the controller I need to format this date so I'm using a $filter('date'),
so here is the input field:
<div class="input-group">
<input id="fechasolicitudc" type="text" class="form-control"
ng-class="(form.fechasolicitudc.$invalid) && (submitted) ? 'error': '' "
ng-style="(form.fechasolicitudc.$invalid) && (submitted) && {'background-color':'pink'}"
name="fechasolicitudc" uib-datepicker-popup="dd/MM/yyyy"
ng-model="vm.peticion.contacto.fechaSol"
is-open="vm.datePickerOpenStatus.fechasolicitudc"/>
<span class="input-group-btn">
<button type="button" class="btn btn-default"
ng-click="vm.openCalendar('fechasolicitudc')">
<i class="glyphicon glyphicon-calendar"></i>
</button>
</span>
</div>
and in my controller:
if (vm.peticion.contacto.fechaSol != null) {
var d = $filter('date')(vm.peticion.contacto.fechaSol, 'yyyy-MM-dd');
vm.peticion.contacto.fechaSol = d;
}
what happenes is that the date is updated in the DB but the field becomes erased.
When I try give the input type="date" the field is not erased but the calendar popup does not work.