Skip to content

Commit

Permalink
Current timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbrendel committed May 15, 2024
1 parent 4d5bd92 commit bced10c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/controller/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public function index($request)
}

$timezone_identifiers = timezone_identifiers_list();
$current_timezone = app('timezone', date_default_timezone_get());

$plant_attributes = PlantDefAttrModel::getAll();

return parent::view(['content', 'admin'], [
Expand All @@ -61,6 +63,7 @@ public function index($request)
'themes' => $themes,
'api_keys' => $api_keys,
'timezone_identifiers' => $timezone_identifiers,
'current_timezone' => $current_timezone,
'plant_attributes' => $plant_attributes,
'new_version' => $new_version,
'current_version' => $current_version
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<div class="control">
<select class="input" name="timezone">
@foreach ($timezone_identifiers as $timezone_identifier)
<option value="{{ $timezone_identifier }}" {{ (($timezone_identifier === app('timezone')) ? 'selected' : '') }}>{{ $timezone_identifier }}</option>
<option value="{{ $timezone_identifier }}" {{ (($timezone_identifier === $current_timezone) ? 'selected' : '') }}>{{ $timezone_identifier }}</option>
@endforeach
</select>
</div>
Expand Down

0 comments on commit bced10c

Please sign in to comment.