Time zone should always be UTC

Will implement display time zones on a per user basis
This commit is contained in:
Lance Pioch 2024-05-07 21:54:24 -04:00
parent a050fbd2d3
commit 1b3017222e
5 changed files with 4 additions and 30 deletions

View File

@ -35,7 +35,6 @@ class AppSettingsCommand extends Command
{--new-salt : Whether or not to generate a new salt for Hashids.}
{--author= : The email that services created on this instance should be linked to.}
{--url= : The URL that this Panel is running on.}
{--timezone= : The timezone to use for Panel times.}
{--cache= : The cache driver backend to use.}
{--session= : The session driver backend to use.}
{--queue= : The queue driver backend to use.}
@ -61,6 +60,8 @@ class AppSettingsCommand extends Command
*/
public function handle(): int
{
$this->variables['APP_TIMEZONE'] = 'UTC';
if (empty(config('hashids.salt')) || $this->option('new-salt')) {
$this->variables['HASHIDS_SALT'] = str_random(20);
}
@ -83,12 +84,6 @@ class AppSettingsCommand extends Command
config('app.url', 'https://example.com')
);
$this->output->comment(__('commands.appsettings.comment.timezone'));
$this->variables['APP_TIMEZONE'] = $this->option('timezone') ?? $this->anticipate(
'Application Timezone',
\DateTimeZone::listIdentifiers(),
config('app.timezone')
);
$selected = config('cache.default', 'file');
$this->variables['CACHE_STORE'] = $this->option('cache') ?? $this->choice(

View File

@ -38,7 +38,6 @@ class InfoCommand extends Command
['Debug Mode', $this->formatText(config('app.debug') ? 'Yes' : 'No', !config('app.debug') ?: 'bg=red')],
['Installation URL', config('app.url')],
['Installation Directory', base_path()],
['Timezone', config('app.timezone')],
['Cache Driver', config('cache.default')],
['Queue Driver', config('queue.default')],
['Session Driver', config('session.driver')],

View File

@ -1,19 +0,0 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class BladeServiceProvider extends ServiceProvider
{
/**
* Perform post-registration booting of services.
*/
public function boot(): void
{
$this->app->make('blade.compiler')
->directive('datetimeHuman', function ($expression) {
return "<?php echo \Carbon\CarbonImmutable::createFromFormat(\Carbon\CarbonImmutable::DEFAULT_TO_STRING_FORMAT, $expression)->setTimezone(config('app.timezone'))->toDateTimeString(); ?>";
});
}
}

View File

@ -4,7 +4,6 @@ return [
App\Providers\ActivityLogServiceProvider::class,
App\Providers\AppServiceProvider::class,
App\Providers\BackupsServiceProvider::class,
App\Providers\BladeServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\Filament\AdminPanelProvider::class,
App\Providers\HashidsServiceProvider::class,

View File

@ -37,12 +37,12 @@
<td>{{ $key->memo }}</td>
<td>
@if(!is_null($key->last_used_at))
@datetimeHuman($key->last_used_at)
{{ $key->last_used_at }}
@else
&mdash;
@endif
</td>
<td>@datetimeHuman($key->created_at)</td>
<td>{{ $key->created_at }}</td>
<td>
<a href="#" data-action="revoke-key" data-attr="{{ $key->identifier }}">
<i class="fa fa-trash-o text-danger"></i>