beforeShowDay option added. Iterate over each day before rendering calendar. Useful when highlight or disable day in calendar. or add custom class. example: datetimepicker({ beforeShowDay: function( date ){ return ‘my-custom-class’} });

This commit is contained in:
Fazle Elahee 2014-04-29 18:12:32 +01:00
parent fe0e89445a
commit 3333300169

View File

@ -888,6 +888,11 @@
classes.push('xdsoft_weekend'); classes.push('xdsoft_weekend');
} }
if(options.beforeShowDay && typeof options.beforeShowDay == 'function')
{
classes.push(options.beforeShowDay(start))
}
table+='<td data-date="'+d+'" data-month="'+m+'" data-year="'+y+'"'+' class="xdsoft_date xdsoft_day_of_week'+start.getDay()+' '+ classes.join(' ')+'">'+ table+='<td data-date="'+d+'" data-month="'+m+'" data-year="'+y+'"'+' class="xdsoft_date xdsoft_day_of_week'+start.getDay()+' '+ classes.join(' ')+'">'+
'<div>'+d+'</div>'+ '<div>'+d+'</div>'+
'</td>'; '</td>';