twitter bootstrap - Bootstrap3 Datetimepicker issues: missing icon, how to use Date() function? -
i'm using bootstrap3 datetimepicker packaged meteor on site:
https://github.com/tsega/meteor-bootstrap3-datetimepicker
i have 2 problems.
1) there no calendar icon on button click open calendar.
2) date() function fails error: "exception in template helper: typeerror: $(...).datetimepicker(...).date not function".
here's included via command line:
meteor add jquery meteor add mrt:moment meteor add twbs:bootstrap meteor add tsega:bootstrap3-datetimepicker
it possible these weren't right packages, did working...
i've followed example on author's page. here's javascript:
if (meteor.isclient) { template.say_when.onrendered(function() { this.$('.datetimepicker').datetimepicker({ }).on('dp.change', function(e){ session.set("selected", e.date.format()); }); }); template.say_when.helpers({ // works show_date: function(){ return session.get("selected"); }, // fails test: function(){ var date = $('.datetimepicker').datetimepicker().date(); console.log("date picker: " + date); } }); }
and here's html:
<head> <title>datetimepicker</title> </head> <body> <h1>bootstrap3 datetimepicker in meteor</h1> {{> say_when}} </body> <template name="say_when"> <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> <p>{{show_date}}</p> <p>{{test}}</p> </template>
1) there else need add in order calendar icon?
2) how can make date() function work?
Comments
Post a Comment