jQuery bootstrap-datetimepicker更改事件 [英] jQuery bootstrap-datetimepicker change event

查看:938
本文介绍了jQuery bootstrap-datetimepicker更改事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用了Jonathan Peterson的 bootstrap-datetimepicker插件.

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

我遇到更改事件的问题:

如果我定义这样的事件:

If I define event like this :

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

我收到错误消息:

未捕获的TypeError:e.date不是函数

Uncaught TypeError: e.date is not a function

任何人都知道如何在变更事件上获取新的日期值吗?

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

推荐答案

看着该链接,您似乎很靠近.您需要删除括号以获取正确的值.当前尝试记录该值的方式使浏览器认为它需要调用函数.

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

这篇关于jQuery bootstrap-datetimepicker更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆