Actions
Defect #29816
closedMyHelper::render_activity_block is not timezone aware
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
Actions