var dt1 = '2013-11-11'
var dt2 = '2013-10-12'
dt1 = dt1.substr(0, dt1.indexOf(" ")).replace(/-/g, "/");
dt2 = dt2.substr(0, dt2.indexOf(" ")).replace(/-/g, "/");
var day = (new Date(dt1) - new Date(dt2)) / (1000 * 60 * 60 * 24) //比较两个之间的相隔天数
alert(day);