beforeShowDay is called for every date shown on the calender. When beforeShowDay is called, you need to determine if the date passed to it is the last day of the month.
The following JScript will return the last day of the month for a given year and month.
function LastDayOfMonth(Year, Month)
{
return(new Date((new Date(Year, Month,1))-1)).getDate();
}
Use the following code to determine if the beforeShowDay's date is the last of the month:
$('.selector').datepicker({
beforeShowDay: function (date) {
//getDate() returns the day (0-31)
if (date.getDate() == LastDayOfMonth(date.getMonth(), date.getFullYear())) {
return [true, ''];
}
return return [false, ''];
}
});