I want to print the number of days from the selected date. Instead of printing the number of days from the current date to the previous date, it prints results it in milliseconds. snippet below
$scope.countDays= function( d2) {
var diff = Math.abs(new Date().getTime() - d2.getTime());
alert(diff); //prints milliseconds
return diff / (1000 * 60 * 60 * 24);
};
<input ng-model="dateSelection" ng-change="countDays(dateSelection)">
how can I print the exact days difference in actual integer and disable future date selection