The DatePicker will always open on the date which is selected in the input. I need to open DatePicker at the current month, no matter what date is selected in the input.
I have tried the following, but it will change the value of the input as well, which is not desirable.
beforeShow: function() {
$(input).datepicker("setDate", "0");
}
After playing with it for a while I did it this way:
$('input').datepicker({
beforeShow: function(input, inst) {
setTimeout(function() {
var date = new Date();
inst.selectedDay = date.getDate();
inst.drawMonth = inst.selectedMonth = date.getMonth();
inst.drawYear = inst.selectedYear = date.getFullYear();
$.datepicker._adjustDate(input);
}, 1);
}
});