Home › Forums › Calendar Products › Events Calendar PRO › Start date displays end date
- This topic has 5 replies, 2 voices, and was last updated 11 years, 7 months ago by
Barry.
-
AuthorPosts
-
June 10, 2014 at 7:23 am #216791
barn2media
ParticipantHello,
On the individual event page the “Start” date and time is showing incorrectly for events that are longer than 1 day long.
The “Start” field shows the “End” date and time. If you view the example URL I’ve added to this post you’ll see that both the start and end show “June 13 @ 4:30 pm”, where as the start should show “June 13 @ 4:30 pm”.
Taking a deeper look I see that that this is handled under /modules/meta/details.php and this file can be overridden by themes.
I have reverted back to the default plugin file and also checked my theme and the details.php files and the code are identical.
It looks like the tribe_get_start_date() function is not actually calling the start date.
Many thanks for your help.
Steven
June 10, 2014 at 7:25 am #216793barn2media
ParticipantThis reply is private.
June 10, 2014 at 4:06 pm #217519Barry
MemberThanks for sharing those details.
I have to say I’m a bit perplexed and even if I faithfully set up an event with the same start and end dates/times I can’t see the problem locally. I do see you noted having already tried deactivating all other plugins and switching to a default, unmodified theme such as Twenty Thirteen … can you confirm what the outcome of that test was?
Thanks!
June 14, 2014 at 4:14 pm #226097barn2media
ParticipantHello,
Thanks for your reply. On further diagnosis I’ve found out that this issue is happening when the following code is added to the function file of the theme. This snippet was provided by tribe as a way to disable past events from showing on the front end.
This is needed on our website but it seems to be breaking the Start and End date display:
add_filter(‘tribe_events_pre_get_posts’, ‘filter_tribe_all_occurences’, 100);
function filter_tribe_all_occurences ($wp_query) {
if ( !is_admin() ) {
$new_meta = array();
$today = new DateTime();
// Join with existing meta_query
if(is_array($wp_query->meta_query))
$new_meta = $wp_query->meta_query;
// Add new meta_query, select events ending from now forward
$new_meta[] = array(
‘key’ => ‘_EventEndDate’,
‘type’ => ‘DATETIME’,
‘compare’ => ‘>=’,
‘value’ => $today->format(‘Y-m-d H:i:s’)
);
$wp_query->set( ‘meta_query’, $new_meta );
}
return $wp_query;
}June 16, 2014 at 8:21 am #229479Barry
MemberOK – so that’s from this thread, right?
If so, it looks like Brook left that open and is waiting on your confirmation that it works – so if there’s a problem with that snippet and you want to hit Brook up for some extra ideas on that front, that’s probably the best course of action here 🙂
September 4, 2014 at 7:54 pm #723292Barry
MemberHi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!
-
AuthorPosts
- The topic ‘Start date displays end date’ is closed to new replies.
