Previous/Next Link issue with timezone

Home Forums Ticket Products Community Tickets Previous/Next Link issue with timezone

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1028773
    Outdoor Outreach
    Participant

    Hello, I hope you are doing well.

    I had an issue with the previous event link on my website, the issue was that the previous link was “looping” between two events from the same day. I found out how to fix it but I wanted to let you know so you can investigate.

    – The WordPress timezone is set to Los Angeles
    – Function: get_event_link() in Tribe/Main.php
    – $post->EventStartDate is set to “2015-12-02 23:00:00”
    – in the DB, _EventStartDate is set to “2015-12-02 15:00:00”
    – in the DB, _EventStartDateUTC is set to “2015-12-02 23:00:00”

    The issue is that the query needs to compare $post->EventStartDate with _EventStartDateUTC and not _EventStartDate. I fixed the issue by changing to following code:


    $args = array(
    'post__not_in' => array( $post->ID ),
    'order' => $order,
    'orderby' => "TIMESTAMP( $wpdb->postmeta.meta_value ) ID",
    'posts_per_page' => 1,
    'meta_query' => array(
    array(
    'key' => '_EventStartDateUTC',
    'value' => $post->EventStartDate,
    'type' => 'DATETIME',
    'compare' => $direction,
    ),
    array(
    'key' => '_EventHideFromUpcoming',
    'compare' => 'NOT EXISTS',
    ),
    'relation' => 'AND',
    ),
    );

    Let me know if it helps.

    Thank you,
    Matt

    #1029641
    Josh
    Participant

    Hey Matt,

    Thanks for reaching out to us!

    I’ll run this by one of our developers to review and consider for inclusion in an upcoming update to the plugin. We appreciate the input and will follow up with you in this thread.

    Thanks!

    #1075744
    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 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Previous/Next Link issue with timezone’ is closed to new replies.