app/models/hearing_day.rb
def begins_at
    # If 'first_slot_time' column has a value, use that
    if first_slot_time.present?
      combine_time_and_date(first_slot_time, "America/New_York", scheduled_for)
    end
  end
# In order to display timeslots for the various regional_office we need to know
# what time the first slot should be. This method returns that information as
# a string representing an iso8601 formatted datetime
#
# Examples:
# "2021-04-23T08:30:00-04:00"
# "2021-04-23T09:00:00-04:00"
# "2021-04-23T08:00:00-06:00"
#
# This may seem unnessecarily complex, when we could more simply send a time string like "08:30"
# Sending a string like "08:30" does not end up being simpler in practice. It moves the work
# of knowing/figuring out the timezone elsewhere (the front-end).
#
# The iso8601 strings come from a combination of these three pieces:
# - Time: first_slot_time, or a default string like "09:00"
#    - first_slot_time is ALWAYS in eastern time.
# - Timezone: regional office's timezone property like "America/Los_Angeles"
# - Date: from the scheduled_for column for this hearing_day
In order to display timeslots for the various regional_office we need to know
what time the first slot should be. This method returns that information as
a string representing an iso8601 formatted datetime



This may seem unnessecarily complex, when we could more simply send a time string like "08:30"
Sending a string like "08:30" does not end up being simpler in practice. It moves the work
of knowing/figuring out the timezone elsewhere (the front-end).

The iso8601 strings come from a combination of these three pieces:
Time: first_slot_time, or a default string like "09:00"
first_slot_time is ALWAYS in eastern time.
Timezone: regional office's timezone property like "America/Los_Angeles"
Date: from the scheduled_for column for this hearing_day
In order to display timeslots for the various regional_office we need to know what time the first slot should be . This method returns that information as a string representing an iso8601 formatted datetime This may seem unnessecarily complex when we could more simply send a time string like " 08 : 30 " Sending a string like " 08 : 30 " does not end up being simpler in practice . It moves the work of knowing / figuring out the timezone elsewhere ( the front - end ) . The iso8601 strings come from a combination of these three pieces : Time : first_slot_time or a default string like " 09 : 00 " first_slot_time is ALWAYS in eastern time . Timezone : regional office ' s timezone property like " America / Los_Angeles " Date : from the scheduled_for column for this hearing_day
def begins_at
    if first_slot_time.present?
      combine_time_and_date(first_slot_time, "America/New_York", scheduled_for)
    end
  end
def begins_at if first_slot_time . present? combine_time_and_date ( first_slot_time , "America/New_York" , scheduled_for ) end end
In order to display timeslots for the various regional_office we need to know
what time the first slot should be.
In order to display timeslots for the various regional_office we need to know what time the first slot should be .
# If 'first_slot_time' column has a value, use that