javascript - Why is Jquery UI Datepicker not making dates unavailable? -


i'm developing datepicker allow administrator choose dates holiday makers staying @ property, , store data in database. want update datepicker potential customers see unavailable dates greyed out.

i've managed retrieve data database , pass via json js variable i'm having no luck greying out beforeshowday method. console.log on datestoblock var showed following info:

object {fromdate: "2014-02-28", todate: "2014-02-23"}  

and code far.

var datestoblock = <?php echo json_encode($unavailabledates); ?>;     $(function() {       var unavailabledates = ["false","","not available"];        $( "#fromdatepicker" ).datepicker({         dateformat: "yy-mm-dd",         beforeshowday: function(datestoblock) {           return unavailabledates;         }       });   }); 


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -