From 1cc999a4f9f6022838a91a068df1da9a5b78a1bd Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Tue, 6 Feb 2018 10:59:31 -0600 Subject: [PATCH] Change Airport tz field to timezone --- .../migrations/2017_06_11_135707_create_airports_table.php | 2 +- app/Models/Airport.php | 4 ++-- resources/views/admin/airports/fields.blade.php | 6 +++--- resources/views/admin/airports/script.blade.php | 4 ++-- resources/views/admin/flights/flight_fields.blade.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Database/migrations/2017_06_11_135707_create_airports_table.php b/app/Database/migrations/2017_06_11_135707_create_airports_table.php index 399a1e11..e56aaafc 100644 --- a/app/Database/migrations/2017_06_11_135707_create_airports_table.php +++ b/app/Database/migrations/2017_06_11_135707_create_airports_table.php @@ -14,7 +14,7 @@ class CreateAirportsTable extends Migration $table->string('name', 100); $table->string('location', 100)->nullable(); $table->string('country', 64)->nullable(); - $table->string('tz', 64)->nullable(); + $table->string('timezone', 64)->nullable(); $table->boolean('hub')->default(false); $table->unsignedDecimal('fuel_100ll_cost', 8)->nullable()->default(0); $table->unsignedDecimal('fuel_jeta_cost', 8)->nullable()->default(0); diff --git a/app/Models/Airport.php b/app/Models/Airport.php index 5e8edfac..2045973b 100644 --- a/app/Models/Airport.php +++ b/app/Models/Airport.php @@ -90,8 +90,8 @@ class Airport extends BaseModel /** * @return string */ - public function getTimezoneAttribute(): string + public function getTzAttribute(): string { - return $this->tz; + return $this->timezone; } } diff --git a/resources/views/admin/airports/fields.blade.php b/resources/views/admin/airports/fields.blade.php index 30e5f41a..658bb455 100644 --- a/resources/views/admin/airports/fields.blade.php +++ b/resources/views/admin/airports/fields.blade.php @@ -54,9 +54,9 @@
- {!! Form::label('tz', 'Timezone:') !!} - {!! Form::select('tz', $timezones, null, ['class' => 'select2']); !!} -

{{ $errors->first('tz') }}

+ {!! Form::label('timezone', 'Timezone:') !!} + {!! Form::select('timezone', $timezones, null, ['class' => 'select2']); !!} +

{{ $errors->first('timezone') }}

diff --git a/resources/views/admin/airports/script.blade.php b/resources/views/admin/airports/script.blade.php index 75774798..2f4a670d 100644 --- a/resources/views/admin/airports/script.blade.php +++ b/resources/views/admin/airports/script.blade.php @@ -46,8 +46,8 @@ $(document).ready(function() { $("#" + key).val(value); - if(key === 'tz') { - $("#tz").trigger('change'); + if(key === 'timezone') { + $("#timezone").trigger('change'); } }); }); diff --git a/resources/views/admin/flights/flight_fields.blade.php b/resources/views/admin/flights/flight_fields.blade.php index ff4869b4..7461380b 100644 --- a/resources/views/admin/flights/flight_fields.blade.php +++ b/resources/views/admin/flights/flight_fields.blade.php @@ -52,7 +52,7 @@ ['type' => 'submit', 'class' => 'btn btn-success btn-s']) !!}

{{ $errors->first('name') }}

-

{{ $errors->first('tz') }}

+

{{ $errors->first('value') }}

{!! Form::close() !!}