I am trying to pass 2 php arrays $date_array and $drop_array into javascript so their values can be checked and pushed into a pre existing javascript array.
<?php
$date_array = array('12-08-2016', '12-09-2016', '12-10-2016', '12-12-2016', '12-13-2016', '12-14-2016', '12-15-2016', '12-16-2016', '12-17-2016');
$drop_array = array($drop1, $drop2, $drop3, $drop4, $drop5, $drop6, $drop7, $drop8, $drop9);
?>
where $drop1-$drop9 are numeric values. I am currently passing the arrays like this and pushing their values into an array:
var date_array = '<?php echo json_encode($date_array); ?>';
var drop_array = '<?php echo json_encode($drop_array); ?>';
var disabledSpecificDays = ["12-11-2016","12-18-2016","12-16-2016","12-17-2016"];
for (var x = 0; x < drop_array.length; x++){
var j = drop_array[x];
if (j > 75){
disabledSpecificDays.push(date_array[x]);
}
}
Currently doing this and adding the dates to the array breaks my calendar. When i dont have this code and just add the dates manually to the array the calendar works fine disables the dates so i think it is how im passing the php values and trying to push them into an array