strDate=Date.parse(strDate.replace('/-/g','/')); endDate=Date.parse(endDate.replace('/-/g','/')); var diffDate=(endDate-strDate)+1*24*60*60*1000; var days=diffDate/(1*24*60*60*1000);