Does not support cron range (',','-')
See original GitHub issueThe package doesn’t seem to support cron statement w/ range syntax, such as "00 00 * * * 6-7"
or "00 00 * * * 6,7"
, is this a bug or feature request?
Behavior noticed using the following…
Version: 2.4.1
Environment:
Local time: Sun 2017-07-02 13:59:22 PDT
Universal time: Sun 2017-07-02 20:59:22 UTC
RTC time: Sun 2017-07-02 20:59:22
Time zone: America/Los_Angeles (PDT, -0700)
Repro:
// expected
00 00 * * * 6-7 2017-07-02T14:00:00-07:00
00 00 * * * 7 2017-07-02T14:00:00-07:00
00 00 * * * 6,7 2017-07-02T14:00:00-07:00
// actual
00 00 * * * 6-7 2017-07-08T00:00:00-07:00
00 00 * * * 7 2017-07-02T14:00:00-07:00
00 00 * * * 6,7 2017-07-08T00:00:00-07:00
Script (using moment-timezone for clarity):
const cronParser = require("cron-parser");
const moment = require("moment-timezone");
let timezone = "America/Los_Angeles"
let patterns = [
"00 00 * * * 6-7",
"00 00 * * * 7",
"00 00 * * * 6,7",
];
let args = {
iterator: true,
currentDate: '2017-07-02T13:25:00-07:00',
tz: timezone,
};
patterns.forEach((pattern) => {
let iterator = cronParser.parseExpression(pattern, args);
let next = moment(iterator.next().value.toISOString()).tz(timezone).format();
console.log(pattern, next);
});
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Will crontab hour range a-b run after b too? - Stack Overflow
cron will run jobs when the time matches the expression provided. Your expression tells it to run when the minute is divisible by...
Read more >12.3 Understanding Cron Syntax in the Job Scheduler
The cron triggers you can configure in the Orchestration Server Job ... HINT:When you use the L option, be careful not to specify...
Read more >Reference: Cron and rate expressions for Systems Manager
(State Manager doesn't currently support specifying months in cron expressions for associations.) ... The - (dash) wildcard specifies ranges.
Read more >Why is my crontab not working, and how can I troubleshoot it?
Cron is all things considered a very basic scheduler and the syntax does not easily allow an administrator to formulate slightly more uncommon...
Read more >New in Spring 5.3: Improved Cron Expressions
Use the first three letters of the particular day or month (case does not matter). Here are some examples: Cron Expression, Meaning. 0...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@BuZzy1337 haven’t really had time to look into this. It’s still top priority tho. Trying to look into this as soon as possible. Thank you reminding this!
Any solution in sight for this issue?