I am having a bit of trouble with jQuery datepicker. I need multiple ranges for date selection. For example user should be able to select a range between(d-m-y) 1/8/2015 and 5/8/2015. But also a range between: 16/8/2015 to 20/8/2015 (in the same calendar). The dates that do not match those ranges should be inactive. I ended up trying following code but with no success:
$(function() {
var ds = array('1-8-2015', '16-8-2015'),
de = array('5-8-2015', '20-8-2015');
$('#datepicker').datepicker({
beforeShow: function() {
return {
dateFormat: 'd-m-yy',
minDate: ds,
maxDate: de,
}
}
});
});
JSFiddle example: JSfiddle
Any ideas? Regards, Simon