longbill/jquery-date-range-picker

Event is not working

losewin opened this issue · 1 comments

Why is it not working? already tried the .on('datepicker-change') and .bind('datepicker-change') but still won't trigger

var today=new Date()
		today.setDate(today.getDate()+1)
		jQuery('#datepicker').dateRangePicker({
			startDate: today,
			inline:true,
			showTopbar:false,
			container: '.daterangepicker',
			alwaysOpen:true,
			stickyMonths:true,
			// customArrowPrevSymbol:'<i class="fa fa-angle-left"></i>',
			// customArrowNextSymbol:'<i class="fa fa-angle-right"></i>',
			/*hoveringTooltip: function(days, startTime, hoveringTime){
				$('.ifly-widget .departure-picker button.nights').text(days+' Days')
				return days
			}*/
		}).bind('datepicker-change',function(event, obj){
			console.log('change',event, obj)
			// $('departure-selection')
		})

But its working fine on the Demo

This happens because the element does not exists but the container does, which datepicker-change event can't be attached to the jQuery('#datepicker') element