Home › Forums › Calendar Products › Events Calendar PRO › Google Structured Data and Time Offset
- This topic has 8 replies, 5 voices, and was last updated 6 years, 5 months ago by Victor.
-
AuthorPosts
-
May 23, 2017 at 10:23 pm #1288150MathewParticipant
I’m researching and issue where an event is, for example, at 7:30 pm CST on a particular day. When doing a google search, the event is showing on the following day.
When viewing the JSON-LD data, the timezone offset is not been set. It’s appending +00:00 on EVERY event.
As a working example, visit your demo page and run it through the Google’s Testing Tool.
The event is on 2017/05/11, but the startdate is 2017-05-12T01:00:00+00:00, which is partially correct, up to the offset. Google will show the event as Friday the 12th. See the attached screenshot from wpshindig’s testing results.
I built a clean test site with Twenty Seventeen and the only the latest TEC plugins and was able to reproduce the issue. Even changing the WP timezone from Chicago to UTC-5 had no effect on the results.
Here’s an article I found on the issue, but it went quiet.
May 25, 2017 at 4:25 pm #1289136NealModeratorHey Matthew,
Thanks for reaching out. Let’s see what’s going on with this timezone issue. You’re right, the timezone offset is showing +00:00 on google.
Before we begin, can you confirm with me that you enabled timezone support in your Events Calendar? You can find it in Events > Settings in the General tab. We also have a guide here: https://theeventscalendar.com/knowledgebase/working-with-timezones/.
If this was already enabled and you’re still seeing issues, can you share your system info with me? Also, if you have a site up that I can look at, that would be a great help!
Cheers,
NealMay 28, 2017 at 1:28 am #1290075MathewParticipantNeal,
I’ve tried all the various settings in TEC to no avail. However, I found this little gem and it resolved the issue. Thanks @nicosantos for the snippet!
As I mentioned, the issue is present on the TEC demo site.
May 30, 2017 at 10:40 am #1290911NealModeratorHey Matthew,
Awesome, I’m glad you found that snippet and it resolved your issue! I checked our bug log and I do see a bug similar to what you described. We are aware of it and are working on it.
Thanks for looking out Matthew. Please let me know if you need anything else or have anymore questions.
Cheers,
NealJune 9, 2017 at 5:19 pm #1296013MathewParticipantAfter implementing Nico’s custom function, it had a negative effect on Google search results. I tweaked the function a bit and after a week, search results are now correct.
Here’s what I came up with. The key is, and pass it along, using UTC with no offset.
function tribe_modify_json_ld_event_dates ( $_data, $args, $event ) {
$_data->startDate = date_create( tribe_get_start_date( $event->ID, true, Tribe__Date_Utils::DBDATETIMEFORMAT ) )->setTimezone( new DateTimeZone( 'UTC' ) )->format( 'c' );
$_data->endDate = date_create( tribe_get_end_date( $event->ID, true, Tribe__Date_Utils::DBDATETIMEFORMAT ) )->setTimezone( new DateTimeZone( 'UTC' ) )->format( 'c' );return $_data;
}
add_filter( 'tribe_json_ld_event_object','tribe_modify_json_ld_event_dates', 10, 3 );June 14, 2017 at 8:51 am #1297817NealModeratorHey Matthew,
Awesome, thanks for sharing that snippet! I’m sure anyone looking for this will be able to reuse this.
Cheers,
NealJuly 6, 2017 at 9:35 am #1316866Support 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 TeamNovember 2, 2017 at 7:54 pm #1374319VictorKeymasterHey There!
Just wanted to share with you that a new maintenance release (for the Week of 1st November 2017) is out, including a fix for this issue 🙂
Find out more about this release → https://theeventscalendar.com/maintenance-release-for-the-week-of-1-november-2017/
Please update the plugins and see if the fix works for your site. Don’t hesitate to open a new topic if anything comes up.
Best,
Victor -
AuthorPosts
- The topic ‘Google Structured Data and Time Offset’ is closed to new replies.