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

It is unable to parse a bit complex ones. #23

Open
hasibsahibzada opened this issue Sep 23, 2021 · 2 comments
Open

It is unable to parse a bit complex ones. #23

hasibsahibzada opened this issue Sep 23, 2021 · 2 comments

Comments

@hasibsahibzada
Copy link

I get the parsing error Failed to parse the following CRON expression: 0 9 1-7,15-21 * 1

A good example is a bi-weekly cron expression which is also fairly common => 0 9 1-7,15-21 * 1 see it here crontab.guru .

@lorisleiva
Copy link
Owner

Hi there 👋

This is actually a duplicate of #18 but because it defines the problem more clearly, I'll keep this one and close the other one.

For now these patterns are recognised via regexes and so we would need one that can recognise all the different permutations of pattern taking into the account the operators' order of precedence.

It is on my pipeline to handle this issue but I'd be more than happy to accept a PR for this in the meantime.

The expected result for these permutations of patterns would be to count how many times per period they run.

For instance: 0 9 1-7,15-21 * * would be something like: 14 days a month, at 9am.

We loose a bit of information but this is done intentionally as this package is trying to output something that a human could quickly understand without having to read it multiple time. Of course other suggestions are welcome too. 🙂

@DaaN88
Copy link

DaaN88 commented Aug 10, 2022

Has anything been done to solve the problem? Other than shutting down the PR?

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

No branches or pull requests

3 participants