Home › Forums › Calendar Products › Events Calendar PRO › Tribe__Events__Main::POSTTYPE and time zone issues
- This topic has 5 replies, 3 voices, and was last updated 10 years ago by
Support Droid.
-
AuthorPosts
-
April 6, 2016 at 9:00 am #1098960
Ben
ParticipantHi all, I’m currently using
Tribe__Events__Main::POSTTYPEto return a list of upcoming events, however Events Calendar doesn’t follow time zone rules for this loop.Events within the standard plugin templates are fine, but because the events are UTC-6, all events not listed in the plugin templates are displaying as 6 hours into the future (not following the WordPress time zone settings).
Any help?
Here is my current query:
<?php
if ( ! class_exists( 'Tribe__Events__Main' ) )
return;
$upcoming = new WP_Query( array(
'post_type' => Tribe__Events__Main::POSTTYPE,
'posts_per_page' => 8,
'tribe_events_cat' => 'homepage'
) );
?>Thank you!
April 6, 2016 at 7:44 pm #1099343Geoff B.
MemberGood evening Kurt and welcome to the Events Calendar Support forum!
Thank you for reaching out to us.
Just to set expectations, as you might know, the scope of our support is mostly to get our wonderful customers started on the right track to customize their site and to help them in case of issues. We unfortunately do not provide complete support for customization.
With that in mind, my best short term fix would be to replace the WordPress timezone setting from UTC-6 to one from a city that resides in that timezone (e.g.: Chicago) AND setting the Events Calendar timezone to “Use local timezones for each event” ( Events -> Settings -> General)
Let me know how that goes.
Best regards,
Geoff B.April 11, 2016 at 6:59 am #1100741Ben
ParticipantHi Geoff, thanks for the reply. Unfortunately, that doesn’t work. Anything being queried by Tribe__Events__Main::POSTTYPE (per Tribe documentation) doesn’t respond to time zone details.
Any additional help would be appreciated.
Thanks!
April 11, 2016 at 7:44 pm #1101144Geoff B.
MemberHey Ben,
I’m sorry this did not work out for you.
I will run this by Dev tomorrow to see what their take on it is.That being said, I’m wondering if the fact that you are calling the events completely out of the normal loop isn’t the issue ?
For this to work properly the way you are currently doing it, my hunch is that you will need to add in the timezone offset. Not unlike what was suggested in the following thread: https://theeventscalendar.com/support/forums/topic/timezone-issue/#post-1050667
Let me know if that helps.
Have a great day!
Geoff B.
April 12, 2016 at 2:04 pm #1101576Geoff B.
MemberHello again Ben,
As promised, here are the results of the second opinion.
Our dates are stored in two fields:
- _EventStartDateUTC
- _EventStartDate
It sounds like you might be nabbing the wrong one for your purposes.
One is the UTC timezone, will be 6 hours off of local. The other isn’t.Let me know if that helps.
Have a great day!
Geoff B.
April 27, 2016 at 9:35 am #1107749Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Tribe__Events__Main::POSTTYPE and time zone issues’ is closed to new replies.
