jQuery bootstrap-datetimepicker change event

前端 未结 3 549
渐次进展
渐次进展 2020-12-15 15:47

I am using bootstrap-datetimepicker plugin from Jonathan Peterson on my project.

I\'m having a problem with change event :

If I define even

相关标签:
3条回答
  • 2020-12-15 16:32

    Thanks to Kenneth suggestion, I figured out :

    $('#Release').on('dp.change', function(e){ 
        var formatedValue = e.date.format(e.date._f);
        console.log(formatedValue);
    })
    

    Thank you Kenneth :)

    0 讨论(0)
  • 2020-12-15 16:34

    Please use this code to get change event of datetimepicker:

     $('.datepicker').datetimepicker(
        { format: 'MM/DD/YYYY' }).on('dp.change', function (e) {  });
    
    0 讨论(0)
  • 2020-12-15 16:42

    Looking at that link, it appears you are very close. You need to remove the parenthesis to get the right value.The way you currently are trying to log the value makes the browser think it needs to call a function.

    $('#Release').on('dp.change', function(e){ console.log(e.date); })
    
    0 讨论(0)
提交回复
热议问题