The
beforeShowDay callback
allows you to do this. It is a function that takes a Date as a parameter
and returns an array with [0] being true if the date is selectable,
false if not, [1] being a CSS class to apply to that date cell, [2]
being an optional popup tooltip for the date.
- $('#mydate').datepicker({beforeShowDay:
highlightOdds});
- function highlightOdds(date) {
-
return [true, date.getDate() % 2 == 1 ? 'odd' : ''];
- }
and
CSS
- .odd { background-color: yellow; }