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

[5.4] Schedule on Weekends #17085

Merged
merged 1 commit into from
Jan 3, 2017
Merged

[5.4] Schedule on Weekends #17085

merged 1 commit into from
Jan 3, 2017

Conversation

alexbowers
Copy link
Contributor

No description provided.

@GrahamCampbell GrahamCampbell changed the title Schedule on Weekends [5.4] Schedule on Weekends Jan 2, 2017
@GrahamCampbell
Copy link
Member

What's your use case for this please?

@alexbowers
Copy link
Contributor Author

alexbowers commented Jan 2, 2017

I have image processing that I only want to run weekend early mornings (to lessen the load on the servers).

So something like this may be used by me. (This isn't exactly what I do, but an example).

$event->between('02:00', '06:00')->weekends()->getExpression()

@GrahamCampbell
Copy link
Member

As long as you have a use case that's fine. I was just guarding against adding it for the sake of it. :)

@alexbowers
Copy link
Contributor Author

I currently do it in a somewhat messy way, so it is possible without this addition, but it requires the use of the cron method, and manually adding the 0,6 which is not ideal. Much less readable, and since we already have the weekdays figured weekends is the way it should be done. :)

@taylorotwell taylorotwell merged commit b422afa into laravel:5.4 Jan 3, 2017
@dani3l
Copy link

dani3l commented Jan 25, 2017

A while ago I've created a patch for carbon that deals with weekends on different countries
briannesbitt/Carbon#380

Maybe you can implement something like that as well since weekends might not only be saturdays and sundays

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants