Skip to content

Instantly share code, notes, and snippets.

@ihsanberahim
Created September 1, 2014 14:26
Show Gist options
  • Save ihsanberahim/cbf222ae12e0a91857c1 to your computer and use it in GitHub Desktop.
Save ihsanberahim/cbf222ae12e0a91857c1 to your computer and use it in GitHub Desktop.
how to disable/enable and styling some date in the inline jquery calendar
var datesArray = ['2/9/2014'];
(function() {
$( "#datepicker" ).datepicker({
beforeShowDay: function (date)
{
var theday = date.getDate() +'/'+ (date.getMonth()+1) +'/'+ date.getFullYear();
var thedates = datesArray.join('|');
var bookedDateStyle = [true];
if(thedates.indexOf(theday)!=-1)
{
bookedDateStyle = [false];
bookedDateStyle.push("bookedDate");
}
return bookedDateStyle;
}
});
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment