Google Events Timezone Index from json

Home Forums Calendar Products Events Calendar PRO Google Events Timezone Index from json

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1169317
    Brendan Sands
    Participant

    It appears the plugin is passed the incorrect timestamp for our events and this is the time stamp google uses on it’s events listing for the website. The actual event page passes the correct data. Example. An event @ 11AM lists correctly as such on the event detail page on the website. If you google search under the events, that event is listed @ 4PM.

    (detail page) http://www.grotonwellness.com/event/open-house-wellness-festival/
    (google event search) https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=groton+wellness+events&stick=H4sIAAAAAAAAAOPgEOLWT9c3LElPTspKN1JC5mipZidb6efkJyeWZObnwRlWpQXJ-bmZeekKqWWpeSXFALRklvFDAAAA

    Notice the time stamps for each and the dependency.

    #1169968
    Nico
    Member

    Hi there Brendan,

    Thanks for getting in touch!

    I could verify this and I’m mostly sure the difference is related with your timezone setting. Can you please share your system information with me so I can check this?

    Also, not sure what you mean by: “Notice the time stamps for each and the dependency.”. Can you please clarify a bit on it?

    Best,
    Nico

    #1169993
    Brendan Sands
    Participant

    Hi Nico,

    Wordpress is set to New York (it was UTC-5 which was EST). The events settings are set to “Use the sitewide timezone everywhere. The generated ld+json code is printing out this for an event on OCT 8th @ 11:00am – 3:00pm. I can give you access if it will make it easier too. Let me know and I can forward that via secure means.

    <script type="application/ld+json">
    [{"@context":"http://schema.org","@type":"Event","name":"Open House ~ Wellness Festival","description":"<p>FREE Family Wellness Festival ~ Spend a beautiful fall day focusing on your holistic health and wellness.<br />\\nFun Includes: Spa treatments & mini medical services, seminars, dental tour, meet our practitioners, caf\u00e9 samples, special offers, raffles, bouncehouse, farm animals, face painting, special vendors & more</p>\\n","image":"http://www.grotonwellness.com/wp-content/uploads/2016/08/FallOpenHouse-Square-2016.jpg","url":"http://www.grotonwellness.com/event/open-house-wellness-festival/","startDate":"2016-10-08T15:00:00+00:00","endDate":"2016-10-08T19:00:00+00:00","location":{"@type":"Place","name":"Groton Wellness","description":"","url":"http://www.grotonwellness.com/venue/groton-wellness/","address":{"streetAddress":"493-495 Main Street","addressLocality":"Groton","postalCode":"01450","addressCountry":"United States"},"geo":{"@type":"GeoCoordinates","latitude":42.6201939,"longitude":-71.5866538},"telephone":"978-449-9919","sameAs":""},"organizer":{"@type":"Person","name":"Groton Wellness","description":"","url":"http://www.grotonwellness.com/organizer/groton-wellness/","telephone":"978-449-9919","email":"","sameAs":"http://www.GrotonWellness.com"},"offers":[{"@type":"Offer","url":"http://www.grotonwellness.com/event/open-house-wellness-festival/","price":"0","category":"primary","availability":"InStock","validFrom":"2016-08-08T08:00:00+0000","validThrough":"2016-10-08T11:00:00+0000"}]}]
    </script>

    The other item you asked about was a auto correct mistake. Should have been “Notice the time stamps for each and the discrepancy. Apologies.

    • This reply was modified 7 years, 6 months ago by Brendan Sands.
    #1170645
    Nico
    Member

    Thanks for following up Brendan!

    I just searched our backlog and couldn’t find any bugs related to json+ld data being incorrect.

    Can you please share your system information with me so I can check this?

    Please do send system information in a private reply (this doesn’t mean admin user / pass, if you are not sure about it follow this link), I would like to inspect it before trying to reproduce this in my end.

    Best,
    Nico

    #1170821
    Brendan Sands
    Participant

    This reply is private.

    #1171266
    Nico
    Member

    Thanks for sending system info my way!

    I could verify everything looks good on that end and could reproduce the same behaviour in my test site using the same timezone settings New York / UTC -4. When I used UTC the times are not changed and inspecting the plugin code I could verify this conversion to UTC is indeed intentional.

    I’ll flag this for review with the devs and QA team to see if we need to change something or if this is just the way it works!

    I’ll keep you posted about it,
    Best,
    Nico

    #1173714
    Nico
    Member

    Hey Brendan,

    Thanks for the patience while I worked on this!

    We still haven’t concluded if this is a legit bug or not. While the date and time format is correct in UTC, there’s no indicator in the documentation that we should present the dates in UTC.

    Please give the snippet below a try, just paste in into your theme’s (or child theme’s) functions.php file:

    /* Tribe, modify json ld dates */
    function tribe_modify_json_ld_event_dates ( $_data, $args, $event ) {

    $event_tz_string = get_post_meta( $event->ID, '_EventTimezone', true );
    $tz_mode = tribe_get_option( 'tribe_events_timezone_mode', 'event' );
    $tz_string = $event_tz_string && $tz_mode === 'event' ? $event_tz_string : Tribe__Events__Timezones::wp_timezone_string();

    $_data->startDate = date_create( tribe_get_start_date( $event->ID, true, Tribe__Date_Utils::DBDATETIMEFORMAT ) )->setTimezone( new DateTimeZone( $tz_string ) )->format( 'c' );
    $_data->endDate = date_create( tribe_get_end_date( $event->ID, true, Tribe__Date_Utils::DBDATETIMEFORMAT ) )->setTimezone( new DateTimeZone( $tz_string ) )->format( 'c' );

    return $_data;
    }
    add_filter( 'tribe_json_ld_event_object','tribe_modify_json_ld_event_dates', 10, 3 );

    Let me know if the date is correct now,
    Best,
    Nico

    #1173718
    Brendan Sands
    Participant

    Hi Nico,

    Thanks for the follow up. I’ll update the site with the mentioned code.

    #1173732
    Brendan Sands
    Participant

    This reply is private.

    #1175158
    Nico
    Member

    This reply is private.

    #1186405
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Google Events Timezone Index from json’ is closed to new replies.