Date format change issue in input field
Closed this issue · 1 comments
I think there is some issue in the code when we change the date time format of the input with the help of "data-ng-model", it changes the date time format but angular js error class remove from the input. here is the code:
<div class="form-group col-md-2" ng-class="{'has-error': myForm.edtaDate.$error.required, 'has-success': myForm.edtaDate.$valid }"> <label>EDTA</label> <div class="dropdown date_dropdown"> <a class="dropdown-toggle" id="dropdown1" role="button" data-toggle="dropdown" data-target="dropdown1" href="#"> <div class="input-group"> <input type="text" required id="edtaDate" name="edtaDate" class="form-control" data-ng-model="myModel.edtaDate"> <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span> </div> </a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <datetimepicker data-before-render="startDateBeforeRender($dates)" data-ng-model="myModel.edtaDate" data-datetimepicker-config="{ dropdownSelector: '#dropdown1' }"></datetimepicker> </ul> </div> </div>
This code working fine with default date time format, but when I'm adding following line to change the date time format, then angular error class i.e. "has-error" or "has-success" not working:
<input type="text" required id="edtaDate" name="edtaDate" class="form-control" data-ng-model="myModel.edtaDate | date:'yyyy-MM-dd HH:mm'">