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

Limitation of as_schedule_cron_action() #781

Open
shohag121 opened this issue Oct 21, 2021 · 1 comment
Open

Limitation of as_schedule_cron_action() #781

shohag121 opened this issue Oct 21, 2021 · 1 comment
Labels
priority: normal The issue/PR is normal priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug.

Comments

@shohag121
Copy link

Currently, cron scheduler can not be used for scheduling tasks on a certain day (Saturday or Sunday) of the first (second, third, fourth) week every month.

Used schedule string example:

0 12 ? 1/1 SUN#2 *

Thrown Exception

InvalidArgumentException: Weekday must be a value between 1 and 5. 0 given
@shohag121
Copy link
Author

shohag121 commented Oct 21, 2021

I think $weekday should be treated as $day_of_week here instead of only weekdays of the week.

list($weekday, $nth) = explode('#', $value);

the updated library fixed the issue.
https://github.com/dragonmantank/cron-expression/blob/76ec7333bd29db2fe3c883b311412a12e5022796/src/Cron/DayOfWeekField.php#L108

@barryhughes barryhughes added priority: normal The issue/PR is normal priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug. labels Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: normal The issue/PR is normal priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants