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
Post a Comment