【发布时间】:2015-08-01 03:32:06
【问题描述】:
我在流星应用程序中使用 bootstrap 3 日期时间选择器。我正在尝试存储选定的日期,以便以后使用。目前只是试图在控制台中显示选定的日期。当我运行我的程序时,我的日志中没有错误,但是它也没有在日志中显示所选日期。这是我的代码 HTML
<template name="teetimepicker">
<div class="input-group datetimepicker">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input class="set-due-date form-control" type="text"/>
</div>
</template>
.js
if (Meteor.isClient) {
Template.teetimepicker.onRendered(function() {
this.$('.datetimepicker').datetimepicker();
});
function dateSelection(){
var selectedDate = $("#datetimepicker").data("datetimepicker").getDate();
console.log(selectedDate);
};
我再次没有控制台错误,但日志中没有任何内容。我需要为每个用户存储选定的日期。感谢您的帮助!
【问题讨论】:
-
你没有在任何地方调用 your
dateSelection()函数
标签: javascript jquery twitter-bootstrap date meteor