In jQuery DatePicker there is one annoying thing, if you using it as a calendar and depend on selected date. While navigating from month to month it keep selected day activated for all months. I know that this issue exist for more than 6 months and I have reported it to jQuery Team.However I would like to know is there any workarounds or how to disable this behaviour?
Calendar example can be found here
here's a workaround I figured out.
$(function() {
$("#datepicker").datepicker({
onChangeMonthYear: function(year, month, inst) {
var bMonth = (new Date(this.value)).getMonth() != month - 1;
var bYear = (new Date(this.value)).getFullYear() != year;
if (bMonth || bYear) {
setTimeout(function() {
$('.ui-state-active').removeClass('ui-state-active');
}, 5);
}
}
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With