Home › Forums › Ticket Products › Community Tickets › Previous/Next Link issue with timezone
- This topic has 2 replies, 3 voices, and was last updated 8 years, 2 months ago by Support Droid.
-
AuthorPosts
-
November 20, 2015 at 2:16 pm #1028773Outdoor OutreachParticipant
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,
MattNovember 23, 2015 at 6:53 am #1029641JoshParticipantHey 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!
February 18, 2016 at 8:31 am #1075744Support DroidKeymasterThis 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 ‘Previous/Next Link issue with timezone’ is closed to new replies.