<input type="date" id="startDate" />
<input type="date" id="endDate" />
<script>
$("#endDate").click(function () {
var date1 = $("#startDate").val();
var date2 = $("#endDate").val();
var timeDiff = Math.abs(date2.getTime() - date1.getTime());
var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
alert(diffDays);
});
</script>
getTime not work , and this message shown intellisense was unable to determine an accurate completion list for this expression How do I get the difference days between two Dates in this case and how can getTime work with me ?