Refactor all of the unit conversion code
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
{{ Widget::Weather([
|
||||
'icao' => $flight->dpt_airport_id,
|
||||
]) }}
|
||||
|
||||
<br />
|
||||
<h5>{{$flight->arr_airport_id}} METAR</h5>
|
||||
{{ Widget::Weather([
|
||||
'icao' => $flight->arr_airport_id,
|
||||
|
||||
@@ -12,21 +12,10 @@ https://api.checkwx.com/#metar-decoded
|
||||
<td>Conditions</td>
|
||||
<td>
|
||||
{{ $metar['category'] }}
|
||||
|
||||
@if($unit_temp === 'c')
|
||||
{{$metar['temperature']}}
|
||||
@else
|
||||
{{$metar['temperature_f']}}
|
||||
@endif
|
||||
{{ $metar['temperature'][$unit_temp] }}
|
||||
°{{strtoupper($unit_temp)}}
|
||||
@if($metar['visibility'])
|
||||
,
|
||||
visibility
|
||||
@if($unit_dist === 'km')
|
||||
{{$metar['visibility'] / 1000}}
|
||||
@else
|
||||
{{$metar['visibility_nm']}}
|
||||
@endif
|
||||
, visibility {{ $metar['visibility'][$unit_dist] }}
|
||||
@endif
|
||||
{{$unit_dist}}
|
||||
|
||||
@@ -34,6 +23,12 @@ https://api.checkwx.com/#metar-decoded
|
||||
,
|
||||
{{ $metar['humidity'] }}% humidity
|
||||
@endif
|
||||
|
||||
@if($metar['dew_point'])
|
||||
, dew point
|
||||
{{ $metar['dew_point'][$unit_temp] }}
|
||||
°{{strtoupper($unit_temp)}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user