Correct time zone of API dates

Prior to this change, the API returned incorrect dates in UTC instead of
the conference time zone.
This commit is contained in:
Andrew Kvalheim 2022-09-28 13:22:15 -07:00
parent 397341a324
commit 6ce2e66f14
4 changed files with 24 additions and 8 deletions

View file

@ -3,8 +3,11 @@
class EventScheduleSerializer < ActiveModel::Serializer
include ActionView::Helpers::TextHelper
attribute :start_time, key: :date
attributes :room
attributes :date, :room
def date
object.start_time&.change(zone: object.event.program.conference.timezone)
end
def room
object.room.guid