Issue with Timezones in Structured Data

Home Forums Calendar Products Events Calendar PRO Issue with Timezones in Structured Data

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1333103
    Troy
    Participant

    The automated JSON-LD element created on our event pages are not being setup well for Google search results. We are in a UTC -10 timezone so if an event runs from Aug 4th 9:00 AM – 8:00 PM, the structured data created will be Aug 4th 7:00 PM – Aug 5 6:00 AM in UTC. This is causing some of our events to appear on the wrong day or a single day event to will be a two day event when it appears on Google.

    To try and get around this, I have edited /common/src/Tribe/Timezones.php so it no longer converts $new_datetime to the UTC timezone but is there something in settings I can change so I don’t have to update the core file?

    #1333264
    Cliff
    Member

    This reply is private.

    #1333636
    Troy
    Participant

    This reply is private.

    #1333640
    Troy
    Participant

    The file I changed was /wp-content/plugins/the-events-calendar/common/src/Tribe/Timezones.php
    On line 281 I changed:

    if ( $new_datetime && $new_datetime->setTimezone( $utc ) ) {

    to:

    if ( $new_datetime ) {

    I have tried the setting “Use the local timezones for each event” but the issue doesn’t go away.

    #1333803
    Cliff
    Member

    Thanks, Troy.

    I now see this:

    "startDate":"2017-08-12T19:00:00+00:00","endDate":"2017-08-13T03:00:00+00:00"

    So the JSON-LD is technically correct either way, but https://developers.google.com/search/docs/data-types/events does say it should be in the event’s local time, not forced to UTC (+00:00), so I have logged this as a bug internally.

    I’ll mark this ticket as Pending Fix, which means this thread should receive a reply once the applicable fix has been released. I cannot guarantee when it will be fixed as it’s in the development team’s hands now. They need to assign it, code it, test it, and schedule it for release.

    I apologize for this issue and appreciate your understanding and patience.

     

    #1333804
    Cliff
    Member

    Ah, and I found this reported elsewhere, too, actually.

    You might want to try this fix: https://theeventscalendar.com/support/forums/topic/google-search-displays-incorrect-event-date-2/#post-1311048

    If you do try it, please let me know how it goes for you.

    #1333926
    Mathew
    Participant

    Troy,

    As a side note. Make sure that you revert or back out the changes you have made in the Timezones.php file prior to applying the code to the custom functions.php mentioned in the article.

    Hope it helps.

    #1334185
    Cliff
    Member

    Good looking out, Mathew. Thanks! 🙂

    #1344090
    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

    #1374317
    Victor
    Member

    Hi 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

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Issue with Timezones in Structured Data’ is closed to new replies.