Merge pull request #3090 from AndrewKvalheim/api-time-zone
Correct time zone of API dates
This commit is contained in:
commit
749115e507
4 changed files with 37 additions and 7 deletions
|
|
@ -6,8 +6,7 @@ class EventScheduleSerializer < ActiveModel::Serializer
|
|||
attributes :date, :room
|
||||
|
||||
def date
|
||||
t = object.start_time
|
||||
t.blank? ? '' : %( #{I18n.l t, format: :short}#{t.formatted_offset(false)} )
|
||||
object.start_time&.change(zone: object.event.program.conference.timezone)
|
||||
end
|
||||
|
||||
def room
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ class EventSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def scheduled_date
|
||||
t = object.time
|
||||
t.blank? ? '' : %( #{I18n.l t, format: :short}#{t.formatted_offset(false)} )
|
||||
object.time&.change(zone: object.program.conference.timezone)
|
||||
end
|
||||
|
||||
def speaker_ids
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue