Search code examples
javascriptjqueryjquery-ui-datepicker

Need to get date to what the date picker choose


I need your expertise. How can I show up a specific date in a table base on what date range picker select?

Sample: 7-9-2017 - 7-23-2017 output should be: |Sun 9 2017| Mon 10 2017| Tuesday 11 2017| and soon..

Please i need your help guys.. Thank you in advance. Jquery or Javascript should be fine

enter image description here


Solution

  • try to this to get from start date to end date using this way

    var date1 = new Date("7/13/2010");
    var date2 = new Date("12/15/2010");
    var timeDiff = Math.abs(date2.getTime() - date1.getTime());
    var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24)); 
    console.log(diffDays);