• I have been using sportspress for over a year, but have always had issues with the timezone when a calendar is displayed. It always seemed to ignore timezones (so it would should tomorrow even though it was still today, because my timezone was -6 from gmt).
    I submitted a request to the Pro support (i’m a registered/paying user) but did not get a satisfactory response. (basically didn’t think it was an issue).

    Context:
    I have timezone set correctly in WordPress (and Sportspress, since it uses the same value). However:
    – mysql has a different timezone (off by 1 hour), and I can’t change it because it’s on a shared hosting account.
    – php has a different timezone (UTC), and I can’t change that because it’s a shared hosting account.

    What I found that makes it work correctly is by changing class-sp-schedule.php to call date_i18n() instead of date() when getting the date values for the schedule list:

    		if ( $this->date !== 0 ):
    			if ( $this->date == 'w' ):
    				$args['year'] = date_i18n('Y');
    				$args['w'] = date_i18n('W');
    			elseif ( $this->date == 'day' ):
    				$args['year'] = date_i18n('Y');
    				$args['day'] = date_i18n('j');
    				$args['monthnum'] = date_i18n('n');
    			elseif ( $this->date == 'range' ):
    				add_filter( 'posts_where', array( $this, 'range' ) );
    			endif;
    		endif;
    

    Not sure if I know the overall ramifications of this, but it makes the list of events work correctly. If there is some other setting or fix that I am missing, please let me know.

    Thanks!

Viewing 1 replies (of 1 total)
  • Roch

    (@rochesterj)

    Hi!

    Thanks a lot for this suggestion as well!

    This was an issue that I’ve seen every now and then, and honestly I never thought it was a code issue as well.

    But our devs will know better about the issue and its ramificaitons

    Thanks!
    Kind Regards,
    -Roch

Viewing 1 replies (of 1 total)
  • The topic ‘Timezone issues with schedule/calendar list’ is closed to new replies.