When booking, I stored the time using $filter('date')($scope.booktime, 'mediumTime'). After booking, I have an editbooking function where I pass the time and encounter an error in the console: Error: [ngModel:datefmt] Expected 11:59:00 AM
to be a date. I have been trying to solve this for three days but have been unsuccessful. I want to pass 11:59:00 AM to the time input field.
function HistoryCtrl($scope, $filter) {
$scope.booktime = "11:59:00 AM";
}
<div ng-app ng-controller="HistoryCtrl">
<div class="col">
<label class="item item-input item-stacked-label">
<span class="input-label" >Time</span>
<input type="time" ng-model="booktime" name="booktime" min="09:00:00" max="21:00:00" required="">
</label>
<div class="form-error" ng-messages="projectForm.booktime.$error">
<div class="form-error" ng-message="required">* Mandatory</div>
<div class="form-error" ng-message="min">Booking times: 9am - 9 pm</div>
<div class="form-error" ng-message="max">Booking times: 9am - 9 pm</div>
</div>
</div>