Skip to content

Commit

Permalink
Mobile: Update appointments to use VAOS for local time (#12933)
Browse files Browse the repository at this point in the history
* WIP

* Maintain mobile fallback in the event vaos does not return a local time
  • Loading branch information
Tonksthebear authored Jun 9, 2023
1 parent 33be70b commit 6235994
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def build_appointment_model
location:,
minutes_duration: minutes_duration(appointment[:minutes_duration]),
phone_only: appointment[:kind] == PHONE_KIND,
start_date_local: start_date_utc&.in_time_zone(timezone),
start_date_local:,
start_date_utc:,
status:,
status_detail: cancellation_reason(appointment[:cancelation_reason]),
Expand Down Expand Up @@ -230,6 +230,14 @@ def start_date_utc
end
end

def start_date_local
@start_date_local ||= begin
DateTime.parse(appointment[:local_start_time])
rescue
start_date_utc&.in_time_zone(timezone)
end
end

def appointment_type
case appointment[:kind]
when 'phone', 'clinic'
Expand Down

0 comments on commit 6235994

Please sign in to comment.