Tribe__Events__Main::POSTTYPE and time zone issues

Home Forums Calendar Products Events Calendar PRO Tribe__Events__Main::POSTTYPE and time zone issues

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1098960
    Ben
    Participant

    Hi all, I’m currently using Tribe__Events__Main::POSTTYPE to 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!

    #1099343
    Geoff B.
    Member

    Good 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.

    #1100741
    Ben
    Participant

    Hi 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!

    #1101144
    Geoff B.
    Member

    Hey 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.

    #1101576
    Geoff B.
    Member

    Hello again Ben,

    As promised, here are the results of the second opinion.

    Our dates are stored in two fields:

    1. _EventStartDateUTC
    2. _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.

    #1107749
    Support Droid
    Keymaster

    This 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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Tribe__Events__Main::POSTTYPE and time zone issues’ is closed to new replies.