[Rt-commit] r18621 - in rt/3.999/trunk: . etc lib/RT/Action lib/RT/Crypt lib/RT/Interface lib/RT/Model lib/RT/Report lib/RT/Shredder/Plugin sbin share/html/Dashboards share/html/Install share/html/Search share/html/User

sartak at bestpractical.com sartak at bestpractical.com
Mon Mar 2 20:54:37 EST 2009


Author: sartak
Date: Mon Mar  2 20:54:37 2009
New Revision: 18621

Modified:
   rt/3.999/trunk/   (props changed)
   rt/3.999/trunk/etc/RT_Config.pm
   rt/3.999/trunk/lib/RT/Action/Install.pm
   rt/3.999/trunk/lib/RT/Crypt/GnuPG.pm
   rt/3.999/trunk/lib/RT/Interface/Email.pm
   rt/3.999/trunk/lib/RT/Model/TicketCollection.pm
   rt/3.999/trunk/lib/RT/Report/Tickets.pm
   rt/3.999/trunk/lib/RT/Shredder/Plugin/Users.pm
   rt/3.999/trunk/sbin/rt-email-dashboards
   rt/3.999/trunk/share/html/Dashboards/Subscription.html
   rt/3.999/trunk/share/html/Install/Global.html
   rt/3.999/trunk/share/html/Search/Results.tsv
   rt/3.999/trunk/share/html/User/Prefs.html
   rt/3.999/trunk/t/api/date.t

Log:
 r80792 at onn:  sartak | 2009-03-02 20:54:25 -0500
 Rename the user column to time_zone, the config setting to TimeZone


Modified: rt/3.999/trunk/etc/RT_Config.pm
==============================================================================
--- rt/3.999/trunk/etc/RT_Config.pm	(original)
+++ rt/3.999/trunk/etc/RT_Config.pm	Mon Mar  2 20:54:37 2009
@@ -81,14 +81,14 @@
 
 set($MinimumPasswordLength , "5");
 
-=item C<$Timezone>
+=item C<$TimeZone>
 
-C<$Timezone> is used to convert times entered by users into GMT and back again
-It should be set to a timezone recognized by your local unix box.
+C<$TimeZone> is used to convert times entered by users into GMT and back again
+It should be set to a time zone recognized by L<DateTime::TimeZone>.
 
 =cut
 
-set($Timezone , 'US/Eastern');
+set($TimeZone, 'America/New_York');
 
 =back
 

Modified: rt/3.999/trunk/lib/RT/Action/Install.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Action/Install.pm	(original)
+++ rt/3.999/trunk/lib/RT/Action/Install.pm	Mon Mar  2 20:54:37 2009
@@ -136,8 +136,8 @@
         hints is
               'which port your web server will listen to, e.g. 8080',    #loc
         default is defer { RT->config->get( 'web_port' ) };
-    param timezone =>
-        label is 'Timezone',                                   #loc
+    param time_zone =>
+        label is 'Time Zone',                                   #loc
         render as 'Select',
         available are defer {
                 my %map = ( '' => 'System Default' );

Modified: rt/3.999/trunk/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Crypt/GnuPG.pm	(original)
+++ rt/3.999/trunk/lib/RT/Crypt/GnuPG.pm	Mon Mar  2 20:54:37 2009
@@ -2231,7 +2231,7 @@
     if ( $value =~ /^\d+$/ ) {
         $obj->set( value => $value );
     } else {
-        $obj->set( format => 'unknown', value => $value, timezone => 'utc' );
+        $obj->set( format => 'unknown', value => $value, time_zone => 'UTC' );
     }
     return $obj;
 }

Modified: rt/3.999/trunk/lib/RT/Interface/Email.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Interface/Email.pm	(original)
+++ rt/3.999/trunk/lib/RT/Interface/Email.pm	Mon Mar  2 20:54:37 2009
@@ -362,7 +362,7 @@
         require RT::Date;
         my $date = RT::Date->new( current_user => RT->system_user );
         $date->set_to_now;
-        $args{'entity'}->head->set( 'date', $date->rfc2822( timezone => 'server' ) );
+        $args{'entity'}->head->set( 'date', $date->rfc2822( time_zone => 'server' ) );
     }
 
     my $mail_command = RT->config->get('MailCommand');

Modified: rt/3.999/trunk/lib/RT/Model/TicketCollection.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/TicketCollection.pm	(original)
+++ rt/3.999/trunk/lib/RT/Model/TicketCollection.pm	Mon Mar  2 20:54:37 2009
@@ -534,7 +534,7 @@
         # particular single day.  in the database, we need to check for >
         # and < the edges of that day.
 
-        $date->set_to_midnight( timezone => 'server' );
+        $date->set_to_midnight( time_zone => 'server' );
         my $daystart = $date->iso;
         $date->add_day;
         my $dayend = $date->iso;
@@ -635,7 +635,7 @@
         # particular single day.  in the database, we need to check for >
         # and < the edges of that day.
 
-        $date->set_to_midnight( timezone => 'server' );
+        $date->set_to_midnight( time_zone => 'server' );
         my $daystart = $date->iso;
         $date->add_day;
         my $dayend = $date->iso;

Modified: rt/3.999/trunk/lib/RT/Report/Tickets.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Report/Tickets.pm	(original)
+++ rt/3.999/trunk/lib/RT/Report/Tickets.pm	Mon Mar  2 20:54:37 2009
@@ -65,7 +65,7 @@
       my $type (qw(owner creator last_updated_by requestor cc admin_cc watcher))
     {
         push @fields, $type . ' ' . $_, $type . '.' . $_ foreach qw(
-          name email real_name nickname organization lang city country timezone
+          name email real_name nickname organization lang city country time_zone
         );
     }
 

Modified: rt/3.999/trunk/lib/RT/Shredder/Plugin/Users.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Shredder/Plugin/Users.pm	(original)
+++ rt/3.999/trunk/lib/RT/Shredder/Plugin/Users.pm	Mon Mar  2 20:54:37 2009
@@ -132,7 +132,7 @@
 
     # XXX: we want preload only things we need, but later while
     # logging we need all data, TODO envestigate this
-    # $objs->columns(qw(id name email lang timezone
+    # $objs->columns(qw(id name email lang time_zone
     #                   creator Created last_updated last_updated_by));
     if ( my $s = $self->{'opt'}{'status'} ) {
         if ( $s eq 'any' ) {

Modified: rt/3.999/trunk/sbin/rt-email-dashboards
==============================================================================
--- rt/3.999/trunk/sbin/rt-email-dashboards	(original)
+++ rt/3.999/trunk/sbin/rt-email-dashboards	Mon Mar  2 20:54:37 2009
@@ -121,7 +121,7 @@
         next;
     }
 
-    my ($hour, $dow, $dom) = hour_dow_dom_in($user->timezone || RT->config->get('Timezone'));
+    my ($hour, $dow, $dom) = hour_dow_dom_in($user->time_zone || RT->config->get('TimeZone'));
     $hour .= ':00';
     debug "Checking %1's subscriptions: hour %2, dow %3, dom %4",
           $user->name, $hour, $dow, $dom;
@@ -494,7 +494,7 @@
 how often that dashboard is sent and how it's displayed.
 
 Each subscription has an hour, and possibly day of week or day of month. These
-are taken to be in the user's timezone if available, UTC otherwise.
+are taken to be in the user's time zone if available, UTC otherwise.
 
 =head1 SETUP
 

Modified: rt/3.999/trunk/share/html/Dashboards/Subscription.html
==============================================================================
--- rt/3.999/trunk/share/html/Dashboards/Subscription.html	(original)
+++ rt/3.999/trunk/share/html/Dashboards/Subscription.html	Mon Mar  2 20:54:37 2009
@@ -146,7 +146,7 @@
     <option value="<% $formatted %>" <%$selected%>><% $formatted %></option>
 % }
 </select>
-(in <%$timezone%>)
+(in <%$time_zone%>)
 </td></tr>
 <tr><td class="label">
 <&|/l&>Rows</&>:
@@ -185,7 +185,7 @@
 my ($title, @results);
 my ($val, $msg);
 my $Loaded = 0;
-my $timezone = Jifty->web->current_user->user_object->timezone || RT->config->get('Timezone');
+my $time_zone = Jifty->web->current_user->user_object->time_zone || RT->config->get('TimeZone');
 
 use RT::Dashboard;
 my $dashboard_obj = RT::Dashboard->new( current_user => Jifty->web->current_user );

Modified: rt/3.999/trunk/share/html/Install/Global.html
==============================================================================
--- rt/3.999/trunk/share/html/Install/Global.html	(original)
+++ rt/3.999/trunk/share/html/Install/Global.html	Mon Mar  2 20:54:37 2009
@@ -51,10 +51,10 @@
 
 <p><&|/l&>When RT sends an email it sets the From: and Reply-To: headers so users can add to the conversation by just hitting Reply in their mail client.  It uses different addresses for Replies and Comments.  These can be changed for each of your queues.  These addresses will need to be configured to use the <tt>rt-mailgate</tt> program.</&></p>
 
-<p><&|/l&>By default, RT will use the timezone of your system.  This lets you set a global default for the display of dates and times in RT.  Your users can choose a different Timezone in their preferences.</&></p>
+<p><&|/l&>By default, RT will use the time zone of your system.  This lets you set a global default for the display of dates and times in RT.  Your users can choose a different time zone in their preferences.</&></p>
 
 
-<& Elements/Form, fields => [qw/comment_address correspond_address timezone/],
+<& Elements/Form, fields => [qw/comment_address correspond_address time_zone/],
     next => $next,
     next_label => _('Next: ') . _($next_label),
     previous => '/Install/Sendmail.html',

Modified: rt/3.999/trunk/share/html/Search/Results.tsv
==============================================================================
--- rt/3.999/trunk/share/html/Search/Results.tsv	(original)
+++ rt/3.999/trunk/share/html/Search/Results.tsv	Mon Mar  2 20:54:37 2009
@@ -81,7 +81,7 @@
             $row->{$attr} = "";
         } else {
             my $method = '$Ticket->'.$attr.'()';
-            $method =~ s/->iso\(\)$/->iso( Timezone => 'user' )/;
+            $method =~ s/->iso\(\)$/->iso( time_zone => 'user' )/;
             $row->{$attr} = eval $method;
             if ($@) {die "Failed to find $attr - ". $@}; 
         }

Modified: rt/3.999/trunk/share/html/User/Prefs.html
==============================================================================
--- rt/3.999/trunk/share/html/User/Prefs.html	(original)
+++ rt/3.999/trunk/share/html/User/Prefs.html	Mon Mar  2 20:54:37 2009
@@ -79,8 +79,8 @@
     <td class="value"><& /Elements/SelectLang, name => 'lang', default => $user_object->lang &></td>
   </tr>
   <tr>
-    <td class="label"><&|/l&>timezone</&>:</td>
-    <td class="value"><& /Elements/SelectTimezone, name => 'timezone', default => $user_object->timezone &></td>
+    <td class="label"><&|/l&>Time Zone</&>:</td>
+    <td class="value"><& /Elements/SelectTimezone, name => 'time_zone', default => $user_object->time_zone &></td>
   </tr>
 </table>
 </&>
@@ -217,7 +217,7 @@
 		    organization real_name nickname lang email_encoding web_encoding 
 		    ExternalContactInfoId ContactInfoSystem gecos ExternalAuthId 
 		    auth_system HomePhone WorkPhone MobilePhone PagerPhone Address1
-		Address2 City State Zip Country lang timezone
+		Address2 City State Zip Country lang time_zone
 		   );
 
     $m->callback(

Modified: rt/3.999/trunk/t/api/date.t
==============================================================================
--- rt/3.999/trunk/t/api/date.t	(original)
+++ rt/3.999/trunk/t/api/date.t	Mon Mar  2 20:54:37 2009
@@ -19,10 +19,10 @@
 }
 
 {
-    # set timezone in all places to UTC
-    RT->system_user->user_object->__set(column => 'timezone', value => 'UTC')
-                                if RT->system_user->user_object->timezone;
-    RT->config->set( Timezone => 'UTC' );
+    # set time zone in all places to UTC
+    RT->system_user->user_object->__set(column => 'time_zone', value => 'UTC')
+                                if RT->system_user->user_object->time_zone;
+    RT->config->set( TimeZone => 'UTC' );
 }
 
 my $current_user;
@@ -39,54 +39,54 @@
 
 {
     my $date = RT::DateTime->new(current_user => $current_user );
-    is($date->timezone, 'UTC', "dropped all timzones to UTC");
-    is($date->timezone('user'), 'UTC', "dropped all timzones to UTC");
-    is($date->timezone('server'), 'UTC', "dropped all timzones to UTC");
-    is($date->timezone('unknown'), 'UTC', "with wrong context returns UTC");
+    is($date->time_zone, 'UTC', "dropped all timzones to UTC");
+    is($date->time_zone('user'), 'UTC', "dropped all timzones to UTC");
+    is($date->time_zone('server'), 'UTC', "dropped all timzones to UTC");
+    is($date->time_zone('unknown'), 'UTC', "with wrong context returns UTC");
 
-    $current_user->user_object->__set( column => 'timezone', value => 'Europe/Moscow');
-    is($current_user->user_object->timezone,
+    $current_user->user_object->__set( column => 'time_zone', value => 'Europe/Moscow');
+    is($current_user->user_object->time_zone,
        'Europe/Moscow',
-       "successfuly changed user's timezone");
-    is($date->timezone('user'),
+       "successfuly changed user's time_zone");
+    is($date->time_zone('user'),
        'Europe/Moscow',
-       "in user context returns user's timezone");
-    is($date->timezone, 'UTC', "the deafult value is always UTC");
-    is($date->timezone('server'), 'UTC', "wasn't changed");
+       "in user context returns user's time_zone");
+    is($date->time_zone, 'UTC', "the deafult value is always UTC");
+    is($date->time_zone('server'), 'UTC', "wasn't changed");
 
-    RT->config->set( Timezone => 'Africa/Ouagadougou' );
-    is($date->timezone('server'),
+    RT->config->set( TimeZone => 'Africa/Ouagadougou' );
+    is($date->time_zone('server'),
        'Africa/Ouagadougou',
-       "timezone of the RT server was changed");
-    is($date->timezone('user'),
+       "time_zone of the RT server was changed");
+    is($date->time_zone('user'),
        'Europe/Moscow',
-       "in user context still returns user's timezone");
-    is($date->timezone, 'UTC', "the deafult value is always UTC");
+       "in user context still returns user's time_zone");
+    is($date->time_zone, 'UTC', "the deafult value is always UTC");
     
-    $current_user->user_object->__set( column => 'timezone', value => '');
-    is($current_user->user_object->timezone,
+    $current_user->user_object->__set( column => 'time_zone', value => '');
+    is($current_user->user_object->time_zone,
        '',
-       "successfuly changed user's timezone");
-    is($date->timezone('user'),
+       "successfuly changed user's time_zone");
+    is($date->time_zone('user'),
        'Africa/Ouagadougou',
-       "in user context returns timezone of the server if user's one is not defined");
-    is($date->timezone, 'UTC', "the deafult value is always UTC");
+       "in user context returns time zone of the server if user's one is not defined");
+    is($date->time_zone, 'UTC', "the deafult value is always UTC");
 
-    RT->config->set( Timezone => 'GMT' );
-    is($date->timezone('server'),
+    RT->config->set( TimeZone => 'GMT' );
+    is($date->time_zone('server'),
        'UTC',
-       "timezone is GMT which one is alias for UTC");
+       "time zone is GMT which one is alias for UTC");
 
-    RT->config->set( Timezone => '' );
-    is($date->timezone, 'UTC', "dropped all timzones to UTC");
-    is($date->timezone('user'),
+    RT->config->set( TimeZone => '' );
+    is($date->time_zone, 'UTC', "dropped all timzones to UTC");
+    is($date->time_zone('user'),
        'UTC',
        "user's and server's timzones are not defined, so UTC");
-    is($date->timezone('server'),
+    is($date->time_zone('server'),
        'UTC',
-       "timezone of the server is not defined so UTC");
+       "time zone of the server is not defined so UTC");
 
-    RT->config->set( Timezone => 'UTC' );
+    RT->config->set( TimeZone => 'UTC' );
 }
 
 {
@@ -188,36 +188,36 @@
 }
 
 
-{ # positive timezone
-    $current_user->user_object->__set( column => 'timezone', value => 'Europe/Moscow');
+{ # positive time zone
+    $current_user->user_object->__set( column => 'time_zone', value => 'Europe/Moscow');
     my $date = RT::DateTime->new( current_user => $current_user );
-    $date->set( format => 'ISO', timezone => 'utc', value => '2005-01-01 15:10:00' );
-    is($date->iso( timezone => 'user' ), '2005-01-01 18:10:00', "ISO");
-    is($date->w3cdtf( timezone => 'user' ), '2005-01-01T18:10:00+03:00', "W3C DTF");
-    is($date->rfc2822( timezone => 'user' ), 'Sat, 1 Jan 2005 18:10:00 +0300', "RFC2822");
+    $date->set( format => 'ISO', time_zone => 'utc', value => '2005-01-01 15:10:00' );
+    is($date->iso( time_zone => 'user' ), '2005-01-01 18:10:00', "ISO");
+    is($date->w3cdtf( time_zone => 'user' ), '2005-01-01T18:10:00+03:00', "W3C DTF");
+    is($date->rfc2822( time_zone => 'user' ), 'Sat, 1 Jan 2005 18:10:00 +0300', "RFC2822");
 
     # DST
     $date = RT::DateTime->new(current_user =>  $current_user );
-    $date->set( format => 'ISO', timezone => 'utc', value => '2005-07-01 15:10:00' );
-    is($date->iso( timezone => 'user' ), '2005-07-01 19:10:00', "ISO");
-    is($date->w3cdtf( timezone => 'user' ), '2005-07-01T19:10:00+04:00', "W3C DTF");
-    is($date->rfc2822( timezone => 'user' ), 'Fri, 1 Jul 2005 19:10:00 +0400', "RFC2822");
+    $date->set( format => 'ISO', time_zone => 'utc', value => '2005-07-01 15:10:00' );
+    is($date->iso( time_zone => 'user' ), '2005-07-01 19:10:00', "ISO");
+    is($date->w3cdtf( time_zone => 'user' ), '2005-07-01T19:10:00+04:00', "W3C DTF");
+    is($date->rfc2822( time_zone => 'user' ), 'Fri, 1 Jul 2005 19:10:00 +0400', "RFC2822");
 }
 
-{ # negative timezone
-    $current_user->user_object->__set( column => 'timezone', value => 'America/New_York');
+{ # negative time zone
+    $current_user->user_object->__set( column => 'time_zone', value => 'America/New_York');
     my $date = RT::DateTime->new( current_user => $current_user );
-    $date->set( format => 'ISO', timezone => 'utc', value => '2005-01-01 15:10:00' );
-    is($date->iso( timezone => 'user' ), '2005-01-01 10:10:00', "ISO");
-    is($date->w3cdtf( timezone => 'user' ), '2005-01-01T10:10:00-05:00', "W3C DTF");
-    is($date->rfc2822( timezone => 'user' ), 'Sat, 1 Jan 2005 10:10:00 -0500', "RFC2822");
+    $date->set( format => 'ISO', time_zone => 'utc', value => '2005-01-01 15:10:00' );
+    is($date->iso( time_zone => 'user' ), '2005-01-01 10:10:00', "ISO");
+    is($date->w3cdtf( time_zone => 'user' ), '2005-01-01T10:10:00-05:00', "W3C DTF");
+    is($date->rfc2822( time_zone => 'user' ), 'Sat, 1 Jan 2005 10:10:00 -0500', "RFC2822");
 
     # DST
     $date = RT::DateTime->new( current_user =>  $current_user );
-    $date->set( format => 'ISO', timezone => 'utc', value => '2005-07-01 15:10:00' );
-    is($date->iso( timezone => 'user' ), '2005-07-01 11:10:00', "ISO");
-    is($date->w3cdtf( timezone => 'user' ), '2005-07-01T11:10:00-04:00', "W3C DTF");
-    is($date->rfc2822( timezone => 'user' ), 'Fri, 1 Jul 2005 11:10:00 -0400', "RFC2822");
+    $date->set( format => 'ISO', time_zone => 'utc', value => '2005-07-01 15:10:00' );
+    is($date->iso( time_zone => 'user' ), '2005-07-01 11:10:00', "ISO");
+    is($date->w3cdtf( time_zone => 'user' ), '2005-07-01T11:10:00-04:00', "W3C DTF");
+    is($date->rfc2822( time_zone => 'user' ), 'Fri, 1 Jul 2005 11:10:00 -0400', "RFC2822");
 }
 
  # bad format
@@ -291,15 +291,15 @@
     $date->set(format => 'unknown', value => 'weird date');
     is($date->epoch, 0, "date was wrong");
 
-    RT->config->set( Timezone => 'Europe/Moscow' );
+    RT->config->set( TimeZone => 'Europe/Moscow' );
     $date->set(format => 'datemanip', value => '2005-11-28 15:10:00');
     is($date->iso, '2005-11-28 12:10:00', "YYYY-DD-MM hh:mm:ss");
 
-    RT->config->set( Timezone => 'UTC' );
+    RT->config->set( TimeZone => 'UTC' );
     $date->set(format => 'datemanip', value => '2005-11-28 15:10:00');
     is($date->iso, '2005-11-28 15:10:00', "YYYY-DD-MM hh:mm:ss");
 
-    $current_user->user_object->__set( column => 'timezone', value => 'Europe/Moscow');
+    $current_user->user_object->__set( column => 'time_zone', value => 'Europe/Moscow');
     $date = RT::DateTime->new( current_user => $current_user );
     $date->set(format => 'datemanip', value => '2005-11-28 15:10:00');
     is($date->iso, '2005-11-28 12:10:00', "YYYY-DD-MM hh:mm:ss");
@@ -310,11 +310,11 @@
     $date->set(format => 'unknown', value => 'weird date');
     is($date->epoch, 0, "date was wrong");
 
-    RT->config->set( Timezone => 'Europe/Moscow' );
+    RT->config->set( TimeZone => 'Europe/Moscow' );
     $date->set(format => 'unknown', value => '2005-11-28 15:10:00');
     is($date->iso, '2005-11-28 12:10:00', "YYYY-DD-MM hh:mm:ss");
 
-    $date->set(format => 'unknown', value => '2005-11-28 15:10:00', timezone => 'utc' );
+    $date->set(format => 'unknown', value => '2005-11-28 15:10:00', time_zone => 'utc' );
     is($date->iso, '2005-11-28 15:10:00', "YYYY-DD-MM hh:mm:ss");
 
     # test relative dates
@@ -328,52 +328,52 @@
         restore_time();
     }
 
-    RT->config->set( Timezone => 'UTC' );
+    RT->config->set( TimeZone => 'UTC' );
     $date->set(format => 'unknown', value => '2005-11-28 15:10:00');
     is($date->iso, '2005-11-28 15:10:00', "YYYY-DD-MM hh:mm:ss");
 
-    $current_user->user_object->__set( column => 'timezone', value => 'Europe/Moscow');
+    $current_user->user_object->__set( column => 'time_zone', value => 'Europe/Moscow');
     $date = RT::DateTime->new( current_user => $current_user );
     $date->set(format => 'unknown', value => '2005-11-28 15:10:00');
     is($date->iso, '2005-11-28 12:10:00', "YYYY-DD-MM hh:mm:ss");
-    $date->set(format => 'unknown', value => '2005-11-28 15:10:00', timezone => 'server' );
+    $date->set(format => 'unknown', value => '2005-11-28 15:10:00', time_zone => 'server' );
     is($date->iso, '2005-11-28 15:10:00', "YYYY-DD-MM hh:mm:ss");
-    $date->set(format => 'unknown', value => '2005-11-28 15:10:00', timezone => 'utc' );
+    $date->set(format => 'unknown', value => '2005-11-28 15:10:00', time_zone => 'utc' );
     is($date->iso, '2005-11-28 15:10:00', "YYYY-DD-MM hh:mm:ss");
 }
 
 { # SetToMidnight
     my $date = RT::DateTime->new(current_user => RT->system_user);
 
-    RT->config->set( Timezone => 'Europe/Moscow' );
+    RT->config->set( TimeZone => 'Europe/Moscow' );
     $date->set(format => 'ISO', value => '2005-11-28 15:10:00');
     $date->set_to_midnight;
     is($date->iso, '2005-11-28 00:00:00', "default is utc");
     $date->set(format => 'ISO', value => '2005-11-28 15:10:00');
-    $date->set_to_midnight(timezone => 'utc');
+    $date->set_to_midnight(time_zone => 'utc');
     is($date->iso, '2005-11-28 00:00:00', "utc context");
     $date->set(format => 'ISO', value => '2005-11-28 15:10:00');
-    $date->set_to_midnight(timezone => 'user');
+    $date->set_to_midnight(time_zone => 'user');
     is($date->iso, '2005-11-27 21:00:00', "user context, user has no preference, fallback to server");
     $date->set(format => 'ISO', value => '2005-11-28 15:10:00');
-    $date->set_to_midnight(timezone => 'server');
+    $date->set_to_midnight(time_zone => 'server');
     is($date->iso, '2005-11-27 21:00:00', "server context");
 
-    $current_user->user_object->__set( column => 'timezone', value => 'Europe/Moscow');
+    $current_user->user_object->__set( column => 'time_zone', value => 'Europe/Moscow');
     $date = RT::DateTime->new(current_user =>  $current_user );
     $date->set(format => 'ISO', value => '2005-11-28 15:10:00');
     $date->set_to_midnight;
     is($date->iso, '2005-11-28 00:00:00', "default is utc");
     $date->set(format => 'ISO', value => '2005-11-28 15:10:00');
-    $date->set_to_midnight(timezone => 'utc');
+    $date->set_to_midnight(time_zone => 'utc');
     is($date->iso, '2005-11-28 00:00:00', "utc context");
     $date->set(format => 'ISO', value => '2005-11-28 15:10:00');
-    $date->set_to_midnight(timezone => 'user');
+    $date->set_to_midnight(time_zone => 'user');
     is($date->iso, '2005-11-27 21:00:00', "user context");
-    $date->set_to_midnight(timezone => 'server');
+    $date->set_to_midnight(time_zone => 'server');
     is($date->iso, '2005-11-27 21:00:00', "server context");
 
-    RT->config->set( Timezone => 'UTC' );
+    RT->config->set( TimeZone => 'UTC' );
 }
 
 { # set_to_now
@@ -425,7 +425,7 @@
 }
 
 {
-    $current_user->user_object->__set( column => 'timezone', value => '');
+    $current_user->user_object->__set( column => 'time_zone', value => '');
     my $date = RT::DateTime->new(current_user =>  $current_user );
     is($date->as_string, "Not set", "as_string returns 'Not set'");
 
@@ -521,7 +521,7 @@
 }
 
 #TODO: AsString
-#TODO: RFC2822, W3CDTF with timezones
+#TODO: RFC2822, W3CDTF with time zones
 
 exit(0);
 


More information about the Rt-commit mailing list