Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

CronTime day of week is non-standard (Sunday is 1, not 0) #36

Closed
danhbear opened this Issue · 10 comments

3 participants

Daniel Bear Nick Campbell William Khoe
Daniel Bear

The documentation referenced in the readme says that day of week is 1-7, Sunday being 1.
http://help.sap.com/saphelp_xmii120/helpdata/en/44/89a17188cc6fb5e10000000a155369/content.htm

All other crontab documentation I see says that day of the week is 0-6, Sunday being 0.
http://crontab.org/
http://en.wikipedia.org/wiki/Cron
http://www.adminschoice.com/crontab-quick-reference

Mind if I submit a patch to change? Or would you like a "compatibility mode" that explicitly requests real cron times?

I'd also like to support the standard 5-digit crontime syntax that doesn't include seconds. Mind if I submit a patch to default to "a b c d e f" to "0 a b c d e f" ?

Nick Campbell
Owner

Hey,

Yes. I speak patches. :) I would like things to be consistent. Obviously both would break things so I'd upgrade the version and make it clear that there was a break in backwards compatibility. But, I'm ok with this so long as it makes the library more consistent.

William Khoe

Hello,

When is this getting into the code? Currently, it's definitely inconsistent.

Thanks!

Nick Campbell
Owner

I haven't seen a patch for this yet. I'm not sure if anyone is actively working on it.

Daniel Bear

I can pick this up again at some point. @pixelfreak, are you more interested in the 5-digit crontime syntax or the day-of-week inconsistency?

William Khoe

More interested in the day-of-week inconsistency. Thanks!

William Khoe

Actually, I am curious why there exists two different cron format and which is better. For example, the linux cron we are all familiar with can't do seconds interval, but this one can. So maybe it's better to keep it that way?

Daniel Bear

Since linux cron is the standard, personally I think node-cron should be consistent with its syntax/functionality. This would mean changing day-of-week to be consistent. Since the seconds interval doesn't contradict any standard cron syntax, it should just be an optional extended syntax (only if 6 digits are included). Will prepare the patch and see if people need backwards compatibility.

Nick Campbell
Owner
Daniel Bear

Alrighty, pull request up at #41. There are some comments in there. Let me know what you think.

Nick Campbell
Owner

Completed with GH-41.

Nick Campbell ncb000gt closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.