From 73a6e06fd3db5397a5869f8d269728063631dfae Mon Sep 17 00:00:00 2001 From: gotens1211 Date: Mon, 20 Mar 2017 19:11:03 +0530 Subject: [PATCH] Show event time in conference timezone Added an application helper method `time_with_timezone` to return time with the conference timezone which solves the issue of wrong timezone in `scheule.xml` and `admin/events#show`. Fixes #1188 --- app/helpers/application_helper.rb | 5 +++++ app/views/admin/events/_proposal.html.haml | 2 +- app/views/schedules/show.xml.haml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2c5e4ebe..1d91e975 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -34,6 +34,11 @@ module ApplicationHelper result end + # Returns time with conference timezone + def time_with_timezone(time) + time.strftime('%F %R') + ' ' + @conference.timezone.to_s + end + ## # Checks if the voting has already started, or if it has already ended # diff --git a/app/views/admin/events/_proposal.html.haml b/app/views/admin/events/_proposal.html.haml index 26f2f686..24f84f48 100644 --- a/app/views/admin/events/_proposal.html.haml +++ b/app/views/admin/events/_proposal.html.haml @@ -117,7 +117,7 @@ %td %b Scheduled time %td - = @event.time + = time_with_timezone(@event.time) %tr %td %b Submitter diff --git a/app/views/schedules/show.xml.haml b/app/views/schedules/show.xml.haml index 953a331f..7e5ea8e0 100644 --- a/app/views/schedules/show.xml.haml +++ b/app/views/schedules/show.xml.haml @@ -16,7 +16,7 @@ %room{ name: room.name } - events_in_rooms[room].each do |event| %event{ guid: event.guid, id: event.id } - %date= event.time.iso8601 + %date= time_with_timezone(event.time) %start= event.time.strftime('%H:%M') %duration= length_timestamp(event.event_type.length) %room= event.room.name