Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Schedule list timezone #37117

Merged
merged 3 commits into from Apr 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Illuminate/Console/Scheduling/ScheduleListCommand.php
Expand Up @@ -37,8 +37,9 @@ public function handle(Schedule $schedule)
$event->expression,
$event->description,
(new CronExpression($event->expression))
->getNextRunDate(Carbon::now())
->setTimezone($this->option('timezone', config('app.timezone'))),
->getNextRunDate(Carbon::now()->setTimezone($event->timezone))
->setTimezone($this->option('timezone', config('app.timezone')))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't have this foundation config function call.

Copy link
Contributor Author

@bilogic bilogic Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean config('app.timezone')? It was originally there.

Pros: all timezones are based on option/Laravel's .env
Cons: the timezone displayed on output may not be the same as coded, i.e. coded as 0:00 GMT+0, but displayed as 1:00 GMT+1.

My personal preference is to have output displayed as coded.

Actually, I have my own personal schedule:list, I could PR this too if it is welcomed. It has this diffForHumans() and English translation of cron, which helps quite a bit.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GrahamCampbell for command's it's okay since they only work with the base foundation anyway.

->format('Y-m-d H:i:s P'),
];
}

Expand Down