[Rt-commit] r18628 - in rt/3.999/trunk: .
sartak at bestpractical.com
sartak at bestpractical.com
Mon Mar 2 21:33:19 EST 2009
Author: sartak
Date: Mon Mar 2 21:33:19 2009
New Revision: 18628
Modified:
rt/3.999/trunk/ (props changed)
rt/3.999/trunk/lib/RT/DateTime.pm
Log:
r80806 at onn: sartak | 2009-03-02 21:33:14 -0500
_canonicalize_time_zone provides a default time_zone (UTC)
Modified: rt/3.999/trunk/lib/RT/DateTime.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/DateTime.pm (original)
+++ rt/3.999/trunk/lib/RT/DateTime.pm Mon Mar 2 21:33:19 2009
@@ -23,17 +23,18 @@
}
sub _canonicalize_time_zone {
- my $self = shift;
- my $tz = shift;
+ my $self = shift;
+ my $tz = shift;
+ my $default = shift || 'UTC';
if (lc($tz) eq 'user') {
- return $self->current_user->user_object->time_zone;
+ $tz = $self->current_user->user_object->time_zone;
}
elsif (lc($tz) eq 'server') {
- return RT->config->get('TimeZone');
+ $tz = RT->config->get('TimeZone');
}
- return $tz;
+ return $tz || $default;
}
sub new {
More information about the Rt-commit
mailing list