This is my code:
var hideweek;
var day;
var cloDays = new Array();
function initdatepicker(hideweek){
var splitWeek = hideweek.split("&&");
$.each( splitWeek, function( skey, svalue ) {
cloDays[skey] = svalue;
});
$("#datepicker").datepicker({
dateFormat: 'mm-dd-yy',
showOn: "button",
buttonImage: "<? bloginfo('template_directory') ?>/images/cal.png",
buttonImageOnly: true,
minDate: 0,
beforeShowDay: function(date) {
day = date.getDay();<br/>
return [(day !=1 && day !=2)];
}
});
}
On ajax response I called this function 'initdatepicker' with parameter (1&&3&&5). Here 1, 3 and 5 are week days number which I don't want to show. So I split the string (hideweek) and stored in array (cloDays).
Now I need to make this portion of code dynamic.
## return [(day !=1 && day !=2)];