jQuery bootstrap-datetimepicker change event

user5198552 picture user5198552 · Aug 6, 2015 · Viewed 81.4k times · Source

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

I'm having a problem with change event :

If I define event like this :

$('#Release').on('dp.change', function(e){ console.log(e.date()); })

I get the error :

Uncaught TypeError: e.date is not a function

Anyone knows how to get new date value on change event ?

Answer

Kenneth Salomon picture Kenneth Salomon · Aug 6, 2015

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