getting the value of daterangepicker bootstrap

前端 未结 7 1044

Hi im new to using javascript and encountered a problem while using daterangepicker bootstrap. I manage do implement this demo that i got but I am stuck at getting the value of

相关标签:
7条回答
  • 2021-01-30 10:06

    daterangepicker startDate and endDate returns moment objects not Javascript Date objects.

    Here is how to transform a moment object into a date object:

    let startDate = moment($('#selector').data('daterangepicker').startDate).toDate();
    let endDate = moment($('#selector').data('daterangepicker').endDate).toDate();
    
    0 讨论(0)
提交回复
热议问题