jQuery bootstrap-datetimepicker change event

不羁岁月 提交于 2019-11-30 11:20:15

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); })
Mohammed Jikriya

Please use this code to get change event of datetimepicker:

 $('.datepicker').datetimepicker(
    { format: 'MM/DD/YYYY' }).on('dp.change', function (e) {  });

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 :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!