...

View Full Version : jQuery Multiple Dates Picker for jQuery UI



phantom007
10-18-2010, 08:46 AM
http://dubrox.blogspot.com/2010/09/multiple-dates-picker-for-jquery-ui.html

Hi

Does anyone know how to make a callback and know which dates are selected for the following example?



// avoid-dates

$('#avoid-dates').multiDatesPicker({

addAvoidedDates: ['10/1/2010', '11/2/2010', '12/3/2010', '01/4/2011']


});



Thanks

SB65
10-18-2010, 09:43 AM
Since this is an extension to jQuery UI datepicker you should be able to use the standard options and events:


$(function() {
$( "#avoid-dates" ).multiDatesPicker({
onSelect: function(dateText,inst){alert (dateText);}
});

})


does alert the selected date as expected, however, when I try it it no longer seems to accept the dateFormat option. I'm not quite sure where your addAvoidedDates option's coming from either.

phantom007
10-18-2010, 10:13 AM
Hi

Your code works but alerts only the clicked date.

I think I found a solution



$('#show_dates').click(function(e) {
e.preventDefault();
var dates = $('#datepicker').multiDatesPicker('getDates');
var dates_in_string = '';
for(d in dates) dates_in_string+= dates[d]+', ';
alert(dates_in_string);
});



<input type="button" id="show_dates">


Thanks for your kind help :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum