Add user time zone

This commit is contained in:
aignatov-bio 2020-03-06 15:24:57 +01:00
parent b89cc1745a
commit 193c4974d2

View file

@ -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?