pickmeup文檔提供了使用純JavaScript的事件偵聽器的示例,但是如何在jQuery可用並準備好時應用這些事件?在document.ready函數中使用pickmeup datepicker事件偵聽器
pickmeup(element);
element.addEventListener('pickmeup-change', function (e) {
console.log(e.detail.formatted_date); // New date according to current format
console.log(e.detail.date); // New date as Date object
})
下似乎並沒有工作:
$('#pickup_date').on('pickmeup-change', function (e) {
console.log(e.detail.formatted_date); // New date according to current format
console.log(e.detail.date); // New date as Date object
});