I want to calculate the difference between two dates but the result I get is NaN
, this is my code:
var date1 = $("#dateb").val();
var date2 = $("#datea").val();
var date_difference = parseInt((date1-date2)/(24*3600*1000));
alert(date_difference); // NaN
Notice in my datepicker I am using this format:
$('.datePicker').datepicker({
format: 'yyyy/mm/dd'
{);