Is there a way to change the color to, say red, the Sundays in a Jquery Datepicker?
$('#something').datepicker({
beforeShowDay:function(date){
if(date.toString().indexOf('Sun ')!=-1)
return [1,'red'];else
return [1];
}
}
css:
.ui-datepicker td.red a{
color:#f00 !important;
}
Not very beautiful, but works as needed.
For Sundays and Saturdays you can consider using fact that jquery datepicker adds class .ui-datepicker-week-end
so you can add .ui-datepicker-week-end{color:#f00;}
to you css file.
If you want to handle only Sundays you must relay on fact that this will be either first or last column in a table generated by jquery datepicker (it is locale-dependent).
General advice: use firefox+firebug(or sth similiar) to inspect html code. it gives a lot of ideas how to accomplish tasks related to jquery DOM traversing.
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