osem-fcy/app/serializers/event_schedule_serializer.rb
Andrew Kvalheim 6ce2e66f14 Correct time zone of API dates
Prior to this change, the API returned incorrect dates in UTC instead of
the conference time zone.
2022-09-28 13:22:15 -07:00

15 lines
295 B
Ruby

# frozen_string_literal: true
class EventScheduleSerializer < ActiveModel::Serializer
include ActionView::Helpers::TextHelper
attributes :date, :room
def date
object.start_time&.change(zone: object.event.program.conference.timezone)
end
def room
object.room.guid
end
end