Skip to content

Commit e135078

Browse files
authored
[Bug] Refactor usage of time zones (alexjustesen#929)
1 parent 7c53b61 commit e135078

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

app/Console/Kernel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ protected function schedule(Schedule $schedule): void
3939
);
4040
})
4141
->everyMinute()
42+
->timezone($settings->timezone ?? 'UTC')
4243
->when(function () use ($settings) {
4344
// Don't run if the schedule is missing (aka disabled)
4445
if (blank($settings->speedtest_schedule)) {
@@ -48,7 +49,7 @@ protected function schedule(Schedule $schedule): void
4849
// Evaluate if a run is needed based on the schedule
4950
$cron = new CronExpression($settings->speedtest_schedule);
5051

51-
return $cron->isDue();
52+
return $cron->isDue(now()->timezone($settings->timezone ?? 'UTC'));
5253
});
5354
}
5455

app/Filament/Pages/Settings/GeneralPage.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ public function form(Form $form): Form
5252
->required()
5353
->columnSpan(['md' => 2]),
5454
Forms\Components\Select::make('timezone')
55-
->label('Display time zone')
56-
->helperText(new HtmlString('Display time zone only changes the offset in views and <span class="underline">does not</span> effect the scheduler.'))
55+
->label('Time zone')
5756
->options(Timezone::all()->pluck('code', 'code'))
5857
->searchable()
5958
->required(),

app/Http/Controllers/HomeController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class HomeController extends Controller
1414
public function __invoke(Request $request)
1515
{
1616
$settings = new GeneralSettings();
17+
1718
if (! $settings->public_dashboard_enabled) {
1819
return redirect()->route('filament.admin.auth.login');
1920
}

0 commit comments

Comments
 (0)