I’m using a start and end date. But I’m having to add a day to the end date to get it to view properly. Any reason for that? My changes for that are below:
$post_date = substr($post->post_date, 0, 10);
$post_timestamp = strtotime($post->post_date);
to
$time_date = get_field('event_date');
$endDate = get_field('end_date');
$endDate += date_create($endDate);
date_add($endDate, date_interval_create_from_date_string('+1 day'));
$post_date = substr($time_date, 0, 10);
$post_timestamp = strtotime($time_date);
$end_timestamp = strtotime($endDate);
And
$item = array (
"title" => $title,
"color" => $color,
"start" => date('Y-m-d\TH:i:s', $post_timestamp),
"end" => date('Y-m-d\TH:i:s', $post_timestamp),
"url" => get_permalink($post->ID),
'post_id' => $post->ID
);
to
$item = array (
"title" => $title,
"color" => $color,
"start" => date('Y-m-d\TH:i:s', $post_timestamp),
"end" => date('Y-m-d\TH:i:s', $end_timestamp),
"url" => get_permalink($post->ID),
'post_id' => $post->ID
);