Home › Forums › Calendar Products › Events Calendar PRO › Google Events Timezone Index from json
- This topic has 11 replies, 4 voices, and was last updated 7 years, 4 months ago by Brendan Sands.
-
AuthorPosts
-
September 27, 2016 at 10:10 am #1169317Brendan SandsParticipant
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-bmZeekKqWWpeSXFALRklvFDAAAANotice the time stamps for each and the dependency.
September 28, 2016 at 11:32 am #1169968NicoMemberHi 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,
NicoSeptember 28, 2016 at 12:36 pm #1169993Brendan SandsParticipantHi 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.
September 29, 2016 at 12:24 pm #1170645NicoMemberThanks 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,
NicoSeptember 29, 2016 at 6:33 pm #1170821Brendan SandsParticipantThis reply is private.
September 30, 2016 at 3:32 pm #1171266NicoMemberThanks 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,
NicoOctober 7, 2016 at 7:42 am #1173714NicoMemberHey 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,
NicoOctober 7, 2016 at 7:53 am #1173718Brendan SandsParticipantHi Nico,
Thanks for the follow up. I’ll update the site with the mentioned code.
October 7, 2016 at 8:29 am #1173732Brendan SandsParticipantThis reply is private.
October 11, 2016 at 4:26 pm #1175158NicoMemberThis reply is private.
November 2, 2016 at 9:35 am #1186405Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘Google Events Timezone Index from json’ is closed to new replies.