events: [
{
id: '<?php echo $event['id']; ?>',
title: '<?php echo $event['title']; ?>',
color: '<?php echo $event['color']; ?>',
start: '<?php echo $start; ?>',
end: '<?php echo $end; ?>',
dow: '<?php echo $dow; ?>',
ranges: [{
start: '<?php echo $start; ?>',
end: '<?php echo $end; ?>',
}]
},
]
Following image below shows my current status of my calendar:
As seen from the image above, the cardio training has been recurring non-stop. Is there a way to stop the recurring event based on the end date in ranges, other than using event render function?
Take note:
<?php echo $start; ?>
and <?php echo $end; ?>
is a date formatted in YYYY-MM-DD.
UPDATED after attempting ADyson's solution:
<?php foreach ($events as $event): ..... ?>
{
id: '<?php echo $event['id']; ?>',
title: '<?php echo $event['title']; ?>',
color: '<?php echo $event['color']; ?>',
start: '04:00',
end: '05:00',
dow: '<?php echo $dow; ?>',
ranges: [{
start: '<?php echo $start; ?>',
end: '<?php echo $end; ?>',
}]
},
{
id: '<?php echo $event['id']; ?>',
title: '<?php echo $event['title']; ?>',
color: '<?php echo $event['color']; ?>',
start: '<?php echo $start; ?>',
end: '<?php echo $end; ?>',
} <?php endforeach; ?>
Apparently, it went into recurring and non-recurring event objects due to they are in the foreach loop.
SOLUTION
events:[
<?php
inside the foreach loop:
..........
if ($dow == "") {
?>
{
id: '<?php echo $event['id']; ?>',
title: '<?php echo $event['title']; ?>',
color: '<?php echo $event['color']; ?>',
start: '<?php echo $start; ?>',
end: '<?php echo $end; ?>',
},
<?php }
else {?>
{
id: '<?php echo $event['id']; ?>',
title: '<?php echo $event['title']; ?>',
color: '<?php echo $event['color']; ?>',
start: '04:00',
end: '05:00',
dow: '<?php echo $dow; ?>',
ranges: [{
start: '<?php echo $start; ?>',
end: '<?php echo $end; ?>',
}]
},
<?php } ?>
<?php endforeach; ?>