Arushi Arushi - 2 years ago 70
JSON Question

time picker returning null value if start and end time both same

<input type="text" id="from" class="form-control timepicker timepicker-no-seconds" name="start_activity">

<input type="text" id="to" class="form-control timepicker timepicker-no-seconds" name="end_activity">

In script for both is :

i have two time picker in a form but when i am saving start time and end time as same then like start is 4pm and end also 4pm then it returning me the null value in end time when i am getting the value from the database.

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