Level 50
If you are using a carbon instance, you can use the function addDay():
$activity->end_date->addDay()
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
$events[] = Calendar::event(
(@$activity->leavetypes->type_name ? @$activity->leavetypes->type_name : 'N/A'),
true,
new \DateTime($activity->start_date),
new \DateTime($activity->end_date),
true,
[
'color' => '#85e085',
'textColor' => '#008000',
]
);
I have to add 1 Day to end date because I need to counter a bug in fullcalendar which shows -1 day event length please help me.
Use Carbon instead of DateTime, it is included in Laravel.
use Illuminate\Support\Carbon;
// ...
$events[] = Calendar::event(
(@$activity->leavetypes->type_name ? @$activity->leavetypes->type_name : 'N/A'),
true,
Carbon::parse($activity->start_date),
Carbon::parse($activity->end_date)->addDay(),
true,
[
'color' => '#85e085',
'textColor' => '#008000',
]
);
Please or to participate in this conversation.