How to get the selected date value while using Bootstrap Datepicker?

前端 未结 12 969
有刺的猬
有刺的猬 2020-11-28 10:37

Using jquery and the Bootstrap Datepicker, how do I get the new date value I selected using the Bootstrap Datepicker? FYI, I\'m using Rails 3 and Coffescript.

I set

12条回答
  •  星月不相逢
    2020-11-28 10:56

    I was able to find the moment.js object for the selected date with the following:

    $('#datepicker').data('DateTimePicker').date()
    

    More info about moment.js and how to format the date using the moment.js object

提交回复
热议问题