[wp-trac] Re: [WordPress Trac] #9758: GMT-relative timezones inverted

WordPress Trac wp-trac at lists.automattic.com
Mon May 11 22:58:42 GMT 2009


#9758: GMT-relative timezones inverted
-------------------------+--------------------------------------------------
 Reporter:  andy         |        Type:  defect (bug)   
   Status:  new          |    Priority:  highest omg bbq
Milestone:  2.8          |   Component:  Date/Time      
  Version:               |    Severity:  blocker        
 Keywords:  needs-patch  |  
-------------------------+--------------------------------------------------

Comment(by Otto42):

 In wp-includes/functions.php, the wp_timezone_choice() function is what
 builds the dropdown list. This line of code is where you need to add
 something.

 {{{
 $structure .= "\t<option
 ".((($continent.'/'.$city)==$selectedzone)?'selected="selected"':'')."
 value=\"".($continent.'/'.$city)."\">$pad".str_replace('_','
 ',$city)."</option>\n"; //Timezone
 }}}

 Basically, you need to change the display part of that (but not the value
 part) by inverting the +/- when the string matches GMT-X. Something like
 this.

 {{{
 $display = str_replace('_',' ',$city);

 // regex code to match GMT-N and invert the sign goes here.

 $structure .= "\t<option
 ".((($continent.'/'.$city)==$selectedzone)?'selected="selected"':'')."
 value=\"".($continent.'/'.$city)."\">$pad".$display."</option>\n";
 //Timezone
 }}}

 Sorry I haven't had time to make up a patch myself, but I'm busy all week
 helping build our booth for the World Championship BBQ Festival. It's a
 massive affair. We're building an indoor beach. And naturally, BBQ comes
 first above all things. ;)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9758#comment:9>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list