-
Notifications
You must be signed in to change notification settings - Fork 21
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
getNextRunDate is always returning nil #26
Comments
Hi @cliftonmyers, the Additionally, please use the format specified on the Cron Wikipedia page.
|
Okay so i will need to do some hacks on the cronExpressions i am receiving in order to be parsed correctly using your library. What about the operator "/", it is not supported as well right? |
You'll just need to do some find and replace before creating a |
Actually, i searched many pods parsing crons, but yours was the best, others were beginners. I thought that it would cover all the formats, but surprisingly it is not. When i have time i can add support to additional features, but currently i m tight on my deadline, and the "/" will be a blocker for me. Can you find a way to help implementing it soon, and i promise i will be contributing in the future with making this library better. |
There is currently a ticket open for the / operator. I don't have the capacity to work on this myself at present and I'd most likely miss your deadline. What I could do is guide you through the code base and the best way of implementing it. If you're willing to give it a bash, just let me know. |
so basically, you are not using the quartz variation for the cronExpression. Can you tell me which variation you are using, maybe if i get another response with this variation, it could work better. |
The library is using the standard format specified on the Cron Wikipedia page. Implementing the special operators from the Quartz variation is desired, but not yet complete. |
Can you tell me what is wrong with this usage? you can try any of the below cronStrings.
And why it is always returning nil
//"30 9 ? * MON,WED,FRI *" //"30 15 ? * TUE,THU *" //"0 10 ? * MON-FRI *" //"30 18 ? * MON-FRI *" //"0 20 ? * * *" let cronString = "0 8 ? * * *" var calendar = Calendar.current calendar.timeZone = NSTimeZone.local let startOfDate = calendar.startOfDay(for: date) let cronExpression = CronExpression(cronString: cronString) if let nextRunDate = cronExpression?.getNextRunDate(startOfDate) { // should go the code to run on "nextRunDate" }
The text was updated successfully, but these errors were encountered: