harrisiirak / cron-parser

Node.js library for parsing crontab instructions
MIT License
1.32k stars 156 forks source link

Does not support '#' #124

Closed yoavprat closed 5 years ago

yoavprat commented 6 years ago

'#' is allowed for the day-of-week field, and must be followed by a number between one and five. It allows you to specify constructs such as "the second Friday" of a given month. For example, entering "5#3" in the day-of-week field corresponds to the third Friday of every month.

harrisiirak commented 6 years ago

Yet it doesn't seem to part of standard cron syntax. I'm wrong? It seems to be part of CronTrigger/Quartz. Still, the idea itself is worthy to be considered. Adding this as feature request.

kramer65 commented 6 years ago

@harrisiirak - Thanks for pointing me here.

We would be extremely happy with this feature. Are there any plans to implement this anytime soon?

kramer65 commented 6 years ago

@harrisiirak - Would you be willing to accept a donation to add support for # to this library? We could maybe spare say $250?

harrisiirak commented 6 years ago

@kramer65 I'll look into this and try to understand how much work implementing this feature is. I'll be back to you by end of this week.

harrisiirak commented 6 years ago

@kramer65 @yoavapi as I was suspecting this is little bit more difficult to implement. I did put something together, but this isn't good enough (doesn't handle some edge cases very well) to be pushed/merged into master branch. At this point I'll add this as priority for 3.0. I'm not completely burying this for 2.x branch as well, as I may have some enlightenment and find better solution.

No ETA for this at the moment, I'll try to start with as soon as possible.

justintime4tea commented 6 years ago

Also does not support ? as far as I know... could be wrong...

lilybiundo commented 6 years ago

Is there a way to achieve the "third Tuesday of every month" behavior with recurrence rules? I don't specifically need cron style formatting, and the readme says

But if you want to, say, "run this function at the :20 and :50 of every hour on the third Tuesday of every month," you'll find that Node Schedule suits your needs better.

so maybe I'm missing something? Watching this thread for any updates, thanks!

kramer65 commented 5 years ago

@mdbiundo - I guess this lib is meant: https://github.com/node-schedule/node-schedule I don't have experience with it though, s go check it out.

lilybiundo commented 5 years ago

@kramer65 Whoops you're right I mixed up my browser tabs, meant to be looking at that one.

harrisiirak commented 5 years ago

Closed by #155 Credits are going to @DiskImage CC @kramer65 @yoavapi