In angular, I am trying to calculate the number of days between two selected date with using jQuery datepicker. It returns only null with the function that I am using..
However I am not quite sure if it is the function or using datepicker in angular..It looks like the problem is function but it works when I use it with jQuery..
my function:
$scope.dayDiff = function(firstDate,secondDate){
$scope.dayDifference = parseInt(Math.round((secondDate - firstDate) / (1000 * 60 * 60 * 24)));;
}
the rest: http://jsfiddle.net/1mzgLywe/5/
Thanks in advance!
See Question&Answers more detail:os