Timing that returns zero if both start and end time

 <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 :
$('#from').timepicker();
 $('#to').timepicker();

I have two time choices in the form, but when I save the start time and the end time as well as the start, it is 4 pm and ends also 4 pm, after which it returns me a zero value at the end of the time when I get the value from Database.

+4
source share
1 answer

You can use Array.filter:

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

If you do it this way (or the way you have it), make sure that the $ response variable always leads to an array, even if it is empty, or you will have headaches.

+1
source

Source: https://habr.com/ru/post/1682398/


All Articles