-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Set timezone properly in Schedule\Event #7636
Set timezone properly in Schedule\Event #7636
Conversation
Added test after using |
Can you describe the fix. It looks like you are passing the date as a string every time? |
Would like to see this resolved on the cron-expression side of things if possible. |
I'll try yo explain what was happening and the proposed fix: Current $date = Carbon::now();
if ($this->timezone) {
$date->setTimezone($this->timezone);
}
return CronExpression::factory($this->expression)->isDue($date);
This mean the the The fix was to send a modified version of the date. So instead of sending After the conversion in This is a hackish fix sadly, the other fix will be to update CronExpression to support timezone. |
According to this test, this looks like the intended behaviour: |
I've pushed another solution, that only changes one line in the Both fixes are in separate commits. |
I'm gonna close this because this needs to be fixed in cron-expression. |
Since there has been no movement on the library side, we're gonna have to fix this here. Have you tested this solution? |
Set timezone properly in Schedule\Event
An attempt to fix #7573 .
This is very hard to test for and against.
Any ideas for how to create a test for this?