How to +1 day from retrive endDate data in laravel controller?

246 views Asked by At
 I want to get enddate by + 1 day 
$data=[
                    "title" =>$event->event_name,
                    "start" =>$event->start_date,
                    "end" =>new \DateTime($event->end_date.'1 day'),
                    "textColor" =>"white",
                    "backgroundColor" =>"black",
    
                ];

but the code make the fullcalendar not show any data in the view how to make it works + 1 day? thanks before

1

There are 1 answers

2
JD Savaj On BEST ANSWER

Try this code it's work.

<?php  
   $data=[
       "title" => $event->event_name,
       "start" => $event->start_date,
       "end" => date('Y-m-d H:i:s', strtotime($event->end_date . ' +1 day')),
       "textColor" => "white",
       "backgroundColor" => "black",
   ];
?>