Exclude recurrent day in jQuery datepicker

on with 1 Reply

Here i would like to share how to exclude recurrent day from jQuery UI datepicker, Because in some case of web application like online booking, forms are having datepickers, mostly jquery ui datepicker.Here we need to do some manipulation for customizing date picker, Especially exclude recurrent day from datepicker.

We have already seen that how to exclude single date from date picker. There you can get detailed description about jQuery datepicker.So here we go for sample code.

Sample code for exclude recurrent day

 

var excludedays = { "recurrent_day": [0]};

$('#caleder').datepicker({
   beforeShowDay: function(date){
       if(recurrent_day(date)){
           return [false];
       }
       return [true];
   }
});

function recurrent_day(date){
   return ($.inArray(date.getDay(),excludedays.recurrent_day) > -1);
}

I hope this article helps someone.

Posted in jQuery and tagged , , by .

About Gowri

I am professional web developer with 4+ years experience. PHP, jQuery, WordPress, Magento and Symfony2 are my key skills in web development. I am working with strong enthusiastic team with spirit. We provide all web related solution like HTML/CSS development, Web graphic design and Logo.

One thought on “Exclude recurrent day in jQuery datepicker

  1. Pingback: jQuery datepicker exclude date - Code Cocktail

Leave a Reply

Your email address will not be published. Required fields are marked *