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

Incorrect cron description #47

Open
calebdw opened this issue Aug 25, 2024 · 1 comment
Open

Incorrect cron description #47

calebdw opened this issue Aug 25, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@calebdw
Copy link

calebdw commented Aug 25, 2024

Hello!!

Given the following cron:

CronTranslator::translate('3-59/5 * * * *');

This package outputs 57 times every 5 minutes instead of the crontab guru

At every 5th minute from 3 through 59.

Thanks!

@lorisleiva
Copy link
Owner

Hey, thanks for raising that!

You're right that is incorrect.

That's because, this package simplifies ranges (which can be pretty lengthy e.g. 1,3,12-27,30-40,41) to the amount of times they would be triggered so that the output is shorter and less confusing to read.

However, when combined with frequencies (e.g. /5), the result makes little sense and doesn't convey what's actually happening.

Because this package is multi-language I suspect this would actually need a decent refactoring first, allowing different sentence templates so each language can decide how to construct these more complex sentences.

I won't have time to dedicate to this for a while but I'd be more than happy to accept/reviews PRs for it.

@lorisleiva lorisleiva added the help wanted Extra attention is needed label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants