Current Day Off

Home Forums Calendar Products Events Calendar PRO Current Day Off

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #822719
    Jonah
    Participant

    Hi there guys,
    I’ve got a peculiar problem, the current highlighted day is off by one day on my remote site in Safari @ http://www.yogacoop.com/schedule/ – if I view the same site locally in Safari it’s fine: http://sharebucketapp.com/Mjg2ZGVhZmJkOTZiZTY4

    So it appears likely to be a server related issue, I’m just not sure what it could be.

    I’m running the latest versions of all the plugins (TEC & ECP) and WordPress.

    Any help you can provide would be appreciated, thanks,
    Jonah

    #823625
    Brook
    Participant

    Howdy Jonah,

    We have not had the pleasure but your legacy precedes you. I even use some of your more timeless snippets on occasion.

    I have to ask the obvious since we have all been there on occasion, overlooking it. What is your server time? Is it off by a day? What about your server time zone? Are you running the same plugins locally and on the remote? One issue we have seen crop up lately is some plugins that change WP’ Default Timezone (UTC) to the local time. This has certainly caused more than few yesterdays to become today. Outside of that I am not sure. It seems like it would almost definitely have to be a server or timezone issue. Let me know if that helps though, maybe I will have an epiphany between now and then.

    – Brook

    #827048
    Jonah
    Participant

    Hey Brook,

    I’m glad to hear all those years of hard work are still being put to use 🙂

    I think the server time is set to America/Denver: http://sharebucketapp.com/GFmNTk1MWQyZGQ0NjYyN – It’s strange though that that could cause the time to be off by a whole day…

    I am running the exact same plugins locally as on the remote.

    Any other ideas or things I could check on my end?

    Thanks!
    – Jonah

    #828621
    Brook
    Participant

    Howdy Jonah,

    That’s crazy. The class that marks the current day is .tribe-events-present. Here is the relevant logic behind that:

    self::$today = date_i18n( 'd' );
    [...]
    if ( self::$today == $day ) {
    $ppf .= ' tribe-events-present';
    }

    I double checked, the variable $day is taken from the same place as tribe_events_get_current_month_day(). So it seems like date_i18n( ‘d’ ); would have to be returning the wrong date for some reason. What happens if you create a theme override for month/loop-grid.php and just echo date_i18n( ‘d’ ); somewhere? Does it output today, or yesterday?

    – Brook

    #830180
    Jonah
    Participant

    Hey Brook,

    Something very strange is going on either on the server or in Safari. I added the date_i18n() function as an HTML comment which you should be able to see here: http://www.yogacoop.com/schedule/ – look in the source right after the calendar table. It shows the 22nd. If I explicitly go to the month view: http://www.yogacoop.com/schedule/month/ – it shows the 23rd. No idea what this means, are you seeing this too? I wonder if it has anything to do with the PHP version or the new Safari cacheing things more aggressively somehow…??? Any ideas?

    – Jonah

    #832949
    Brook
    Participant

    Howdy Jonah,

    I added the date_i18n() function as an HTML comment which you should be able to see here: http://www.yogacoop.com/schedule/ – look in the source right after the calendar table.

    Thanks for doing that! Really helps narrow it down.

    Safari cacheing things more aggressively somehow…???

    Interesting theory. However I am seeing the exact same thing in Chrome and other browsers.

     If I explicitly go to the month view: http://www.yogacoop.com/schedule/month/ – it shows the 23rd. No idea what this means, are you seeing this too?

    Now that IS odd. I am seeing the same thing. In an effort to duplicate I set Month view to default on my test server, just to see if the dates shifted. No dice, today is still the 24th on both /events/ and /events/month/.

    PHP version is a possibility for sure. Could I get a dump of your system info on the problem server (WP Admin > Events > Settings > Help)?

    Another possibility, and something I have seen a lot of lately, is that something else is setting the timezone to something odd via date_default_timezone_set(). There are a surprising amount of plugins that do this. Since WP Itself sets the zone to UTC in wp-settings.php our plugin relies on that in a few places. When something else changes it odd things happen. Now, why something else would be doing that only on /scheduling/ and only on your live server (PHP version?) I can not yet say. But it is certainly within the realm of possibility. Just to double check, are you running an unmodified WP Core. And if so, did you have a chance to test with a stock theme/only TEC enabled on the live server? I know that’s a pain and unwelcome notion on a live server, but it would eliminate this and other possibilities. Another option might be to setup a test site on the same server and see if the problem carries over. You might also try running date_default_timezone_set( 'UTC' ); right before our HTML comment test code, just in case.

    Thanks, Jonah.

    – Brook

    #841989
    Jonah
    Participant

    This reply is private.

    #841991
    Jonah
    Participant

    Aha, I think I just figured it out! It had something to do with WP Super Cache. It’s off now and the dates are displaying correctly. I’ll do some further troubleshooting on my end but I think we’re good to go here.

    Thanks for all your help!

    – Jonah

    #842851
    Brook
    Participant

    Thanks Jonah! That is really good to know. I will keep an eye out for that in future threads. Maybe we can figure out how to disable or work with super cache in cases like this? Cheers!

    – Brook

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Current Day Off’ is closed to new replies.