Commit a76e75f
committed
fix: OR day-of-month and day-of-week when a field is a full-coverage range
Per crontab(5), when both day fields are restricted (neither contains a
literal "*"), a job runs when either field matches. The criterion is the
"*" character, not whether the value-set covers every value.
getNextDateFrom decided "restricted?" by cardinality
(Object.keys(dayOfMonth).length !== 31, dayOfWeek !== 7), which treats a
full-coverage range such as "1-31", "0-6" or "*/1" as a wildcard even
though it is not "*". As a result "0 0 12 1-31 * 1" fired only on
Mondays instead of every day.
cron-parser 5.6.1 and croniter 6.2.2 both return every day for that
expression from 2026-06-01 (Jun 1, 2, 3, 4); node-cron returned only
Mondays (Jun 1, 8, 15, 22).
Capture whether each day field was a literal "*" at parse time and use
those flags in the day-advance condition instead of the cardinality
proxy.1 parent 8b16b60 commit a76e75f
2 files changed
Lines changed: 46 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
| |||
279 | 286 | | |
280 | 287 | | |
281 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
282 | 293 | | |
283 | 294 | | |
284 | | - | |
| 295 | + | |
285 | 296 | | |
286 | | - | |
287 | | - | |
| 297 | + | |
288 | 298 | | |
289 | 299 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
| 300 | + | |
| 301 | + | |
295 | 302 | | |
296 | 303 | | |
297 | 304 | | |
| |||
501 | 508 | | |
502 | 509 | | |
503 | 510 | | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
504 | 520 | | |
505 | 521 | | |
506 | 522 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
721 | 743 | | |
0 commit comments