Reputation:
$("#datepicker").datepicker({
beforeShowDay: function(date)
{
....
},
onSelect: function(date) {
alert(date);
$(this).addClass('ui-state-custom'); //try one - not work
return[true, "ui-state-custom", "closed"]; //try two - not work
}
}
});
I would like set class ui-state-custom
when onSelect
date (not beforeShowDay
!).
Tell me please how make it?
Upvotes: 0
Views: 3791
Reputation: 82231
You should have checked the console for errors. little embarrassing to explain, its not assClass()
its addClass()
:
$(this).addClass('ui-state-custom'); //try one - should work
highlight selected date:
#ui-datepicker-div .ui-state-active {
background: blue;
color: #555555;
border: 1px solid #D3D3D3;
}
Upvotes: 1
Reputation: 1857
Try this, I hope it should be work fine.
$("#datepicker").datepicker({
beforeShowDay: function(date)
{
....
},
onSelect: function(date) {
alert(date);
$(this).addClass('ui-state-custom'); //try one - not work
return[true, "ui-state-custom", "closed"]; //try two - not work
}
}
});
Upvotes: 1