Refactor all of the unit conversion code

This commit is contained in:
Nabeel Shahzad
2018-04-07 20:52:12 -05:00
parent eae5989845
commit c102a0d858
25 changed files with 365 additions and 362 deletions

View File

@@ -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,

View File

@@ -12,21 +12,10 @@ https://api.checkwx.com/#metar-decoded
<td>Conditions</td>
<td>
{{ $metar['category'] }}
&nbsp;
@if($unit_temp === 'c')
{{$metar['temperature']}}
@else
{{$metar['temperature_f']}}
@endif
{{ $metar['temperature'][$unit_temp] }}
°{{strtoupper($unit_temp)}}
@if($metar['visibility'])
,&nbsp;
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
,&nbsp;
{{ $metar['humidity'] }}% humidity
@endif
@if($metar['dew_point'])
,&nbsp;dew point
{{ $metar['dew_point'][$unit_temp] }}
°{{strtoupper($unit_temp)}}
@endif
</td>
</tr>
<tr>