Storing the selected date on bootstrap 3 date time picker with meteor

I am using bootstrap 3 date time picker in a meteor application. I am trying to store the selected date so I can use it later. Currently just trying to show the selected date in console. When I run my program I have no errors in my log, however it is also not showing the selected date in the log.


if (Meteor.isClient) {
Template.teetimepicker.onRendered(function() {

function dateSelection(){
var selectedDate = $("#datetimepicker").data(“datetimepicker”).getDate();
Again I have no console errors but nothing in the log. I need to store the selected date per each user. Thank You for any help!

And where you call that function to log it ?
I would expect that you need to monitor #datetimepicker element for some event so it knows when to trigger.

I am trying to learn meteor to add to a project I am working on for class. So I am very new and green to it. (meteor is actually an add on nothing that was handled by class). I did call dateSelection(); after the function. Still it wasnt producing anything. I am currently looking at trying to add this to an event template instead. Not sure if I am on the right path. The reason to console.log the dateSelected is only so I know I am capturing it correct. It will be used in a template later. With that being said am I even close?

Also I am looking at the docs for meteor. With the event I am not sure which to call. I don’t believe i want .click since there can be multiple clicks. I just want the final selected date. I am guessing at .data