I am having two dates that is stored in db and am selecting it using $.ajax() and what i need is to show the datepicker values between the dates I selected from db.
I know this is an ancient post but the bug that @TheMuffinMan raised about not being able to get the date format working with the date restriction options is real and appears to only surface when the options are in-line as in his example.
If you have to use this format, and if anyone is still interested, the way around it is to put the date formatting options as the last option in the set. For example the code below works flawlessly for me.
var minDate = -20;
var maxDate = "+1M +10D"
$('body').on('focus',".datepicker", function(){
$(this).datepicker({ minDate: minDate, maxDate: maxDate },{dateFormat: "dd/mm/yy"});
});
I hope it helps someone else.