Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

[Proposal] Add twiceMonthly($first, $second) & endOfMonth() to scheduler. #667

Closed
coderabbi opened this issue Jul 3, 2017 · 6 comments
Closed

Comments

@coderabbi
Copy link

Pretty self-explanatory, the proposed additions are to framework/src/Illuminate/Console/Scheduling/ManagesFrequencies.php to conveniently accommodate two very common use cases for scheduled tasks: twice a month, and end of month.

Precedent exists for twiceMonthly($first, $second) as twiceDaily() already exists, even though it, too, could be accommodated via method chaining.

A related interesting possibility would be to add the ability to specify "end" as a parameter in twiceMonthy($first, $second) and the exiting monthlyOn($day, $time);

I'm open to submitting a PR, just wanted to measure interest, gather feedback first.

@decadence
Copy link

How do you plan implement "end of month"? CRON doesn't support that.
One option is use when callback but seems like none of rules uses it internally.

@coderabbi
Copy link
Author

Indeed, I'd use when() which is used internally already by between($startTime, $endTime).

@coderabbi
Copy link
Author

While on the subject, endOfQuarter() & startOfQuarter() are also common use cases, but let's start with months... 😄

@coderabbi
Copy link
Author

endOfMonth(): laravel/framework#19870

@coderabbi
Copy link
Author

twiceMonthly(): laravel/framework#19874

@coderabbi
Copy link
Author

Going to wait on the reaction to those and feedback here before implementing "end" parameter for twiceMonthly() and monthlyOn().

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

No branches or pull requests

2 participants