Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery移动日期框插件-设置持续时间_Jquery_Jquery Mobile_Datebox - Fatal编程技术网

jQuery移动日期框插件-设置持续时间

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");

anbody知道如何在jQuery()的DateBox插件中设置持续时间吗

我在文件中看不到它

$("#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