I am doing a leaflet plugin and i have a problem with the calendar.
var calen = L.DomUtil.create('div', className, container);
calen.href = '#';
L.DomEvent
.addListener(calen, 'click', L.DomEvent.stopPropagation)
.addListener(calen, 'click', L.DomEvent.preventDefault)
.addListener(calen, 'click', this._buttonExtendCalendaClicked, this);
calen.datepicker({
changeMonth: true,
changeYear: true,
altField: '#date-input',
altFormat: 'mm/dd/yy',
defaultDate: new Date().getTime()
});
the error is: Uncaught TypeError: undefined is not a function
I don't know how can I do it
calen
is initialised by leaflet'sDomUtil.create()
which returns anHTMLElement
jqueryui defines its widgets as jquery plugins, so you need to wrap the HTMLElement in a jquery collection: