I'm currently using aldeed:autoform-bs-datepicker
and rajit:bootstrap3-datepicker
. I would like to limit the date range to year and month. I've tried this in the helpers but it doesn't work. Any thoughts?
Template.user.helpers({
datePicker: function() {
$("#datepicker").datepicker( {
format: "mm/yyyy",
startView: "months",
minViewMode: "months"
});
}
});
Path: Schema.js
Schema.Date = new SimpleSchema({
startDate: {
type: Date,
optional: true,
autoform: {
type: "bootstrap-datepicker",
"data-date-autoclose": "true"
}
}
});
Try this:
You should initialize the
datepicker
when the template is rendered and not on the helper. Hope it helps. Also, make sure the datepicker hasid="datepicker"
If still doesn't work, modify your schema as follows and get rid of
$("#datepicker")
: