mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
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:
parent
fe0e89445a
commit
3333300169
@ -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>';
|
||||||
|
Loading…
Reference in New Issue
Block a user