Trying to use datepicker from jQuery

Hello,

Trying to create a jQuery “datepicker”. It seems like jQuery isn’t loading, but I don’t understand why. I’ve added the jQuery package.

In the browser console I see this:

TypeError: $(…).datepicker is not a function

What do I need to do to ensure jQuery loads? Or is that even my problem?

It gets frustrating. So many complex things in meteor are easy, but sometimes you get in to something like this that should be simple and it really slows you down.

I’ve got this:

Template.myDatePicker.onRendered(function() {
$(’.datePicker’).datepicker();
});

and this:
< template name=‘myDatePicker’>
< input id=‘startDate’ type=“date” name=“startDate” class=“datapicker” />
< /template>

{{> myDatePicker }}

Datepicker is from jQuery UI, it’s not included in base jQuery. Have you added jQuery UI?

Feeling dumb, that worked!

A question, though. There are quite a few different jquery-ui packages on atmosphere. How do I decide which one is…“best”?

Hehe good question :stuck_out_tongue:
I usually look at the number of downloads/stars, and then in the History view to the right to see when it was last updated. And if the name begins with mrt: it means that it’s abandoned.