jquery datepicker - calculate date difference

后端 未结 1 1736
無奈伤痛
無奈伤痛 2021-02-10 07:10

I\'m new at this and I really need your help because I\'ve been struggling for days with this… I want to calculate days between two dates chosen with datepicker. Am I on the rig

1条回答
  •  一整个雨季
    2021-02-10 07:48

    working for me after making this change

        var start = $('#datepicker').datepicker('getDate');
        var end   = $('#datepicker1').datepicker('getDate');
        var days   = (end - start)/1000/60/60/24;
        alert(days);
    

    jsfiddle: http://jsfiddle.net/diode/L2et3/3/

    0 讨论(0)
提交回复
热议问题