WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#12128 closed defect (bug) (duplicate)

get_calendar misaligns 1st line of WP_Widget_Calendar due to incorrect default timezone

Reported by: Tim Melanchuk Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

on single post pages and calendar archive pages, when get_calendar() is called,
$unixmonth gets set to a time based on UTC by mktime() on line ~1008 of general_template.php. this value is used to determine the padding for the calendar
on line ~1120.

however, by the time mktime() is called to determine whether a new table row is
required for the calendar at line ~1140, the default timezone is correctly set.

the result is that for me (on PST) the 1st day of the calendar always starts one day early
and the row has an empty day at the end.

my guess is that the timezone filter:
add_filter( 'pre_option_gmt_offset','wp_timezone_override_offset' );

is not occurring soon enough in these circumstances for the widget to display properly.
the widget does display properly on the home page, or category archives.

on my system, removing the recent change to set the default timezone to UTC at the
beginning of wp_settings.php fixes the problem.

Change History (3)

comment:1 aaron441264 years ago

  • Cc aaron44126 added

comment:2 aaron441264 years ago

I noticed the same problem. Happens using the stock calendar widget with the default theme. I think all you have to do to get this problem is set your blog timezone to something other than (earlier than?) UTC on the General Settings page. (I am UTC-6.)

There are a few forum threads about this as well, going back to about 6 months ago...
http://wordpress.org/support/topic/334516
http://wordpress.org/support/topic/296469
http://wordpress.org/support/topic/192501

comment:3 nacin4 years ago

  • Milestone Unassigned deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Sounds like a duplicate of #11414.

Note: See TracTickets for help on using tickets.