I have a time input field where I am receiving the date and time format 'Thu Jan 01 1970 12:59:00 GMT+0530 (India Standard Time)', but I only want to display the time. Is there an issue with the time picker in AngularJS? Can anyone help me resolve this?
function HistoryCtrl($scope) {
$scope.updateForm = function () {
console.log($scope.booktime);
//here i am getting Thu Jan 01 1970 12:59:00 GMT+0530 (India Standard Time)
};
}
<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>
<button ng-click="updateForm()">Update</button>
</div>