0
 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

NewComes
  • 17
  • 3
  • provided `$event->end_date` is a valid date, `DateTime` can take relative dates, `(new DateTime('2020-11-09 +1 day'))->format('Y-m-d H:i:s');` like so – Kevin Oct 09 '20 at 04:01

1 Answers1

0

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",
   ];
?>
JD Savaj
  • 803
  • 8
  • 16
  • can i ask also var info = Fri Oct 16 2020 07:00:00 GMT+0700 (Western Indonesia Time) how do i get -1 day from var info – NewComes Oct 09 '20 at 04:07
  • do want you like below format time? Fri 16 October 2020 07:00:00 GMT + 0700 (Western Indonesia Time) – JD Savaj Oct 09 '20 at 04:12