Project

General

Profile

Actions

Defect #29816

closed

MyHelper::render_activity_block is not timezone aware

Added by Mizuki ISHIKAWA about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
My page
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

This is a known problem. #14658
The following code can be applied to solve the problem.

diff --git a/app/helpers/my_helper.rb b/app/helpers/my_helper.rb
index 8320749fc0..df0c4cf1d2 100644
--- a/app/helpers/my_helper.rb
+++ b/app/helpers/my_helper.rb
@@ -166,7 +166,7 @@ module MyHelper
   end

   def render_activity_block(block, settings)
-    events_by_day = Redmine::Activity::Fetcher.new(User.current, :author => User.current).events(nil, nil, :limit => 10).group_by(&:event_date)
+    events_by_day = Redmine::Activity::Fetcher.new(User.current, :author => User.current).events(nil, nil, :limit => 10).group_by {|event| User.current.time_to_date(event.event_datetime)}

     render :partial => 'my/blocks/activity', :locals => {:events_by_day => events_by_day}
   end

Related issues

Related to Redmine - Feature #2471: Add my activities to my pageClosedGo MAEDA2009-01-08

Actions
Actions

Also available in: Atom PDF