From 193c4974d268c1fa2e18d5eff5608a4da6110bcc Mon Sep 17 00:00:00 2001 From: aignatov-bio Date: Fri, 6 Mar 2020 15:24:57 +0100 Subject: [PATCH] Add user time zone --- app/services/dashboard/recent_work_service.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/services/dashboard/recent_work_service.rb b/app/services/dashboard/recent_work_service.rb index 6a5aaf0f8..98c0e5910 100644 --- a/app/services/dashboard/recent_work_service.rb +++ b/app/services/dashboard/recent_work_service.rb @@ -87,7 +87,10 @@ module Dashboard activity.each do |key, _value| object_name = activity.delete key if key.to_s.include? 'name' end - activity[:last_change] = I18n.l(DateTime.parse(activity[:last_change]), format: :full_with_comma) + activity[:last_change] = I18n.l( + DateTime.parse(activity[:last_change]).in_time_zone(@user.settings[:time_zone] || 'UTC'), + format: :full_with_comma + ) activity[:name] = escape_input(object_name) activity[:url] = generate_url(activity) activity unless activity[:name].empty?