Arushi Arushi - 1 year ago 70
JSON Question

show events on condition in bootstrap calandar

$('#starttime').html(starttime);
$('#endtime').html(endtime);

}
});
});
</script>



it showing both of the events in the calendar but i want if the status

Answer Source

You could use Array.filter:

...
events: <?= $response ?>.filter(function(x) { return x.status === "1";}),
...                    

If you do it this way (or the way you have it) please ensure that the $response variable always results in an array, even if empty, or you will have headaches.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download