[wp-trac] [WordPress Trac] #12128: get_calendar misaligns 1st line of WP_Widget_Calendar due to incorrect default timezone

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 4 17:58:04 UTC 2010


#12128: get_calendar misaligns 1st line of WP_Widget_Calendar due to incorrect
default timezone
---------------------------+------------------------------------------------
 Reporter:  Tim Melanchuk  |       Owner:            
     Type:  defect (bug)   |      Status:  new       
 Priority:  normal         |   Milestone:  Unassigned
Component:  General        |     Version:            
 Severity:  normal         |    Keywords:            
---------------------------+------------------------------------------------
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12128>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list