Display selected timezone on user's profile
In #15137 (closed) we added a timezone dropdown when editing your profile. The timezone is not yet displayed anywhere yet. We should display the timezone on the user's profile.
Before | After |
---|---|
Implementation plan
- Create a
local_time
helper in app/helpers/time_zone_helper.rb
def local_time(timezone)
time_with_zone_instance = ActiveSupport::TimeZone.new(timezone).now
offset = time_with_zone_instance.utc_offset
formatted_offset = offset / 3600
time_with_zone_instance.strftime("%H:%M (UTC#{formatted_offset})")
end
- Use that helper in app/views/users/show.html.haml#L75
- Add a feature spec in spec/features/users/show_spec.rb