0

I'm new to jquery, I've created a date-picker, I want to deselect the weekend and holidays while end user click the date-picker button. Can you please suggest me how to proceed this?

HTML

<p>Date: <input type="text" id="datepicker"></p>

JS

$(document).ready(function(){
  $("#datepicker").datepicker();
    $("#datepicker").datepicker("option", "dateFormat", "d-M-yy");
  });
});

Please advise.

ajai
  • 187
  • 1
  • 2
  • 15
  • 1
    Might be this will solve your issue http://www.spiceforms.com/blog/how-to-disable-dates-in-jquery-datepicker-a-short-guide/ – Ankit vadariya Apr 26 '17 at 08:45
  • Try using this - you can set the first element in the response `false` to disable the day. http://api.jqueryui.com/datepicker/#option-beforeShowDay All you need then is another array with holiday dates in it which you can compare with, to know whether to disable it nor not. – ADyson Apr 26 '17 at 08:47
  • @Ankit, thanks, the problem solved. – ajai Apr 26 '17 at 08:49

0 Answers0