summaryrefslogtreecommitdiffstats
path: root/extensions/MyDashboard
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/MyDashboard')
-rw-r--r--extensions/MyDashboard/lib/Queries.pm3
-rw-r--r--extensions/MyDashboard/lib/TimeAgo.pm5
2 files changed, 4 insertions, 4 deletions
diff --git a/extensions/MyDashboard/lib/Queries.pm b/extensions/MyDashboard/lib/Queries.pm
index b4d80e2f2..e8813989b 100644
--- a/extensions/MyDashboard/lib/Queries.pm
+++ b/extensions/MyDashboard/lib/Queries.pm
@@ -238,8 +238,9 @@ sub query_flags {
{ Slice => {} }, $user->login);
}
- # Add the fancy date
+ # Format the created date specific to the user's timezone and add the fancy version
foreach my $flag (@$flags) {
+ $flag->{'created'} = format_time($flag->{'created'}, '%Y-%m-%d %H:%M');
my $date_then = datetime_from($flag->{'created'});
$flag->{'created_fancy'} = time_ago($date_then, $date_now);
}
diff --git a/extensions/MyDashboard/lib/TimeAgo.pm b/extensions/MyDashboard/lib/TimeAgo.pm
index f213986d6..b870a292e 100644
--- a/extensions/MyDashboard/lib/TimeAgo.pm
+++ b/extensions/MyDashboard/lib/TimeAgo.pm
@@ -84,9 +84,8 @@ sub time_ago {
croak('Invalid second parameter provided to DateTime::Duration::Fuzzy::time_ago; it must be a DateTime object if provided')
}
- # Use clones in UTC for safe date calculation
- my $now_clone = $now->clone->set_time_zone('UTC');
- my $time_clone = $time->clone->set_time_zone('UTC');
+ 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');
foreach my $range ( @ranges ) {