jQuery移动日期框插件-设置持续时间
anbody知道如何在jQuery()的DateBox插件中设置持续时间吗 我在文件中看不到它jQuery移动日期框插件-设置持续时间,jquery,jquery-mobile,datebox,Jquery,Jquery Mobile,Datebox,anbody知道如何在jQuery()的DateBox插件中设置持续时间吗 我在文件中看不到它 $("#end_date").on("change", function() { if($("#start_date").val() !== "") { if($("#end_date").val() !== "") { var startdate = $("#start_date").datebox("getTheDate");
$("#end_date").on("change", function() {
if($("#start_date").val() !== "") {
if($("#end_date").val() !== "") {
var startdate = $("#start_date").datebox("getTheDate");
var enddate = $("#end_date").datebox("getTheDate");
var duration = enddate.getSeconds() - startdate.getSeconds(); //don't know if I have to make these to Date() objects first?
//Want to set the durationtime here
}
}
});
我试过了
$("#duration").datebox("setTheDate", duration);
$("#duration").trigger("datebox", {"method":"doset"});
但它只在时间框中起作用检查此链接:谢谢!太完美了D