Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何给元素设置datePicker事件? #9

Open
liuyeqing opened this issue Jan 21, 2018 · 1 comment
Open

如何给元素设置datePicker事件? #9

liuyeqing opened this issue Jan 21, 2018 · 1 comment

Comments

@liuyeqing
Copy link

liuyeqing commented Jan 21, 2018

function set_time() {
datePicker({
afterDay: 0, // 第几天后开始可以预约,默认是今天
appointDays: 7, // 默认可以预约未来7天
minuteLater: 20, // 当天的话,默认只能预约20分钟之后,如果两个小时就填120
hourArea: [9, 22], // 预约小时可选的范围,默认是9:00-22:00
interval: 1, // 分钟的间隔,默认一分钟
callBack: function(timeStr, timeStamp) { // 点击确认获取到的时间戳和时间字符串
console.log(timeStr, timeStamp)
}
});
}
$('.input1').on('click', function () {
set_time();
$('.mf-picker').show();
});
以上是我的代码,本来希望能够在点击.input1的时候能够显示时间列表的,但是在点击了1次input以后,第2次点击input就失效了,并且报错:Cannot redefine property: index,不知道怎么解决,请问您有更具体的文档吗?或者您能给我点提示吗?

@jawil
Copy link
Owner

jawil commented Jan 21, 2018

能截个图看看报错详细信息吗?到底哪个 index?不然我很盲目不知道哪一环出错了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants