title: Display specific days in jquery datepicker
body: <p>I have an array which contain name of the days which should be highlighted which I am getting from database.The days which are not in the arrays need not be selected by the user.I have done like this.Unfortunately its not working.</p>
  
  <pre><code>var day_array = ['Sun','Tue','Thu'] //these days should only be selected by user
  $("#collection_date").datepicker(
          {
           minDate:new Date($("#startdate").val()),
           maxDate:new Date($("#enddate").val()),
           beforeShowDay:function(date){
               var day = date.getDay(),Sun=0,Mon=1,Tue=2,Wed=3,Thu=4,Fri=5,Sat=6;
               console.log(day);
               for(var i=0;i&lt;day_array.length;i++)
               {
                   if ($.inArray(day, day_array) == -1)
                  {
                      return [false];
                  }
               }
               return [true];
           }
          }
      );
  </code></pre>
  
  <p>I need to make a datepicker where user can select only Sunday,Tuesday and Thursday.</p>
  
  <p>EDIT:When I am making the final return statement to false,none of the day are highlighted</p>