javascript - Dynamically add jQuery multidatepicker "addDisabledDates" property -


i using jquery multi datepicker in html. need change datepicker setting property dynamically i.e, when choose "normal" option in select box disabled "saturday" , "sunday" in calendar , when choose "custom" option in select box disabled custom days. dont know how specify in code. code

    $('#datepick').multidatespicker({   beforeshowday: disablespecificweekdays,   // disabling "sundays"   dateformat: "d/m/yy",   maxdate: "+3m",   mindate: "-1m",   multidate: true,   adddisableddates: my_array });    function disablespecificweekdays(date) {      var theday = date.getdate() + '/' +(date.getmonth() + 1) + '/' +       date.getfullyear();      var day = date.getday();      return [day != 0 && day != 6]; } 

please 1 me place it?

assuming have dropdown this:

<select id="my-dropdown">     <option value="normal">normal</option>     <option value="custom">custom</option> </select> 

then need is:

function disablespecificweekdays(date) {     if ($('#my-dropdown').val() == 'normal') {         return [true];     }     var theday = date.getdate() + '/' + (date.getmonth() + 1) + '/' +         date.getfullyear();     var day = date.getday();     return [day != 0 && day != 6]; } 

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -