I have HTML5 input fields with type="date":
<div>
Start Date
<input id ="ui-datepicker-start" type="date" ng-model="startDate"
ng-change="updateStartDate(startDate)" value="{{ date | date: 'yyyy/MM/dd' }}" />
End Date
<input id="ui-datepicker-end" type="date" ng-model="endDate"
ng-change="updateEndDate(endDate)" value="{{ date | date: 'yyyy/MM/dd' }}" />
</div>
In Firefox html5 datepickers don't work correctly, they are input type="text" only. I added code for other browsers (which are not support input type="date"):
<script>
if ($('[type="date"]').prop('type') != 'date') {
$('[type="date"]').datepicker();
}
</script>
Now when I run app, I can set date by jquery datepicker(). But now I have a problem. When I change 'start date' and 'end date', they don't call the functions on angular ng-change (ng-change="updateStartDate(startDate)" and ng-change="updateEndDate(endDate)"). How to do it? How to bind changing input dates on angular ng-change functions? Thanks!!!
onchange="angular.element(this).scope().updateEndDate(this)"in your input,