summaryrefslogtreecommitdiffstats
path: root/extensions/MyDashboard/lib/TimeAgo.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-03-22 22:24:09 +0100
committerDave Lawrence <dlawrence@mozilla.com>2013-03-22 22:24:09 +0100
commitddf489ad8abf9e0afa3d4545e784eab7c854bcbe (patch)
tree649afd9c344e95168653179b66432ec35af96a2a /extensions/MyDashboard/lib/TimeAgo.pm
parent2b88ae92c4970f0ff5cccb5b607902f8752590c2 (diff)
downloadbugzilla-ddf489ad8abf9e0afa3d4545e784eab7c854bcbe.tar.gz
bugzilla-ddf489ad8abf9e0afa3d4545e784eab7c854bcbe.tar.xz
Bug 853913 - Some MyDashboard "updated" friendly dates are inappropriate and/or broken w.r.t. timezones
Diffstat (limited to 'extensions/MyDashboard/lib/TimeAgo.pm')
-rw-r--r--extensions/MyDashboard/lib/TimeAgo.pm6
1 files changed, 2 insertions, 4 deletions
diff --git a/extensions/MyDashboard/lib/TimeAgo.pm b/extensions/MyDashboard/lib/TimeAgo.pm
index b870a292e..78badf5fa 100644
--- a/extensions/MyDashboard/lib/TimeAgo.pm
+++ b/extensions/MyDashboard/lib/TimeAgo.pm
@@ -84,14 +84,12 @@ sub time_ago {
croak('Invalid second parameter provided to DateTime::Duration::Fuzzy::time_ago; it must be a DateTime object if provided')
}
- my $now_clone = $now->clone->set_time_zone(Bugzilla->user->timezone);
- my $time_clone = $time->clone->set_time_zone(Bugzilla->user->timezone);
- my $dur = $now_clone->subtract_datetime_absolute( $time_clone )->in_units('seconds');
+ my $dur = $now->subtract_datetime_absolute($time)->in_units('seconds');
foreach my $range ( @ranges ) {
if ( $dur <= $range->[0] ) {
if ( $range->[2] ) {
- return $range->[2]->( $time_clone, $now_clone )
+ return $range->[2]->($time, $now)
}
return $range->[1]
}