[Jifty-commit] r6588 - in jifty/trunk: lib/Jifty

Jifty commits jifty-commit at lists.jifty.org
Mon Mar 16 18:20:08 EDT 2009


Author: sartak
Date: Mon Mar 16 18:20:08 2009
New Revision: 6588

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/DateTime.pm

Log:
 r81205 at onn:  sartak | 2009-03-16 18:12:37 -0400
 Differentiate between input and output time zone


Modified: jifty/trunk/lib/Jifty/DateTime.pm
==============================================================================
--- jifty/trunk/lib/Jifty/DateTime.pm	(original)
+++ jifty/trunk/lib/Jifty/DateTime.pm	Mon Mar 16 18:20:08 2009
@@ -57,13 +57,20 @@
 sub new {
     my $class = shift;
     my %args  = (
-        current_user => undef,
+        current_user     => undef,
+        time_zone        => undef,
+        input_time_zone  => undef,
+        output_time_zone => undef,
         @_,
     );
 
+    my ($input_time_zone, $output_time_zone);
+    $input_time_zone = delete($args{input_time_zone})   || $args{time_zone};
+    $output_time_zone = delete($args{output_time_zone}) || $args{time_zone};
+
     my $current_user = delete $args{current_user};
 
-    my $self = $class->SUPER::new(%args);
+    my $self = $class->SUPER::new(%args, time_zone => $input_time_zone);
 
     my $is_date = $self->hms eq '00:00:00'
                && $self->time_zone->name eq 'floating';
@@ -73,8 +80,8 @@
     # user then set the time zone.
     $self->current_user($current_user);
 
-    if ($args{time_zone}) {
-        $self->set_time_zone($args{time_zone});
+    if ($output_time_zone) {
+        $self->set_time_zone($output_time_zone);
     }
     # If we were given a date, then we need to make sure its output time zone
     # is Floating and it's set to 00:00:00.


More information about the Jifty-commit mailing list