[Jifty-commit] r6538 - in jifty/trunk: lib/Jifty
Jifty commits
jifty-commit at lists.jifty.org
Mon Mar 2 20:12:36 EST 2009
Author: sartak
Date: Mon Mar 2 20:12:36 2009
New Revision: 6538
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/DateTime.pm
Log:
r80778 at onn: sartak | 2009-03-02 20:12:32 -0500
Better current_user/time_zone handling
Modified: jifty/trunk/lib/Jifty/DateTime.pm
==============================================================================
--- jifty/trunk/lib/Jifty/DateTime.pm (original)
+++ jifty/trunk/lib/Jifty/DateTime.pm Mon Mar 2 20:12:36 2009
@@ -113,10 +113,12 @@
sub now {
my $class = shift;
my %args = @_;
+
+ my $current_user = delete $args{current_user};
my $self = $class->SUPER::now(%args);
- $self->set_current_user_timezone()
- unless $args{time_zone};
+ $self->current_user($current_user) if $current_user;
+ $self->time_zone($args{time_zone}) if $args{time_zone};
return $self;
}
@@ -130,10 +132,12 @@
sub from_epoch {
my $class = shift;
my %args = @_;
+
+ my $current_user = delete $args{current_user};
my $self = $class->SUPER::from_epoch(%args);
- $self->set_current_user_timezone()
- unless $args{time_zone};
+ $self->current_user($current_user) if $current_user;
+ $self->time_zone($args{time_zone}) if $args{time_zone};
return $self;
}
More information about the Jifty-commit
mailing list