jQuery selector not working well with jquery-mobile datepicker
===

In my html I have two different datepickers, inside two different divs. I want to do something when selecting a day from the datepicker, like this:

    $('#details1 tr .ui-body-c').on('click', function(){
		$('#details1 .hasDatepicker').hide();
		if($('#date1').val()!="")
		{
			var day=new Date($('#date1').val());
			day.setHours(23);
			day.setMinutes(59);
			day.setSeconds(59);
			
			getDayData(day);
		}
	});
But clicking on the day is not triggering the click event. If I remove the #details1 from the selector the event triggers, but with both of the datepickers.

Here's a link to the datepicker plugin: http://jquerymobile.com/demos/1.0a4.1/experiments/ui-datepicker/

Any thoughts on why is this happening and how to solve it?