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

前端 未结 12 967
有刺的猬
有刺的猬 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:43

    There are many solutions here but probably the best one that works. Check the version of the script you want to use.

    Well at least I can give you my 100% working solution for

    version : 4.17.45

    bootstrap-datetimejs https://github.com/Eonasdan/bootstrap-datetimepicker Copyright (c) 2015 Jonathan Peterson

    JavaScript

    var startdate = $('#startdate').val(); 
    

    The output looks like: 12.09.2018 03:05

提交回复
热议问题