docs(readme): add day of month and day of week OR condition behavior#1040
docs(readme): add day of month and day of week OR condition behavior#1040hackertaco wants to merge 1 commit intokelektiv:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds important documentation clarifying the OR condition behavior when both day of month and day of week fields are specified in cron expressions. This addresses a common misunderstanding documented in issue #890 where users expected an AND condition but got OR behavior, which is the standard POSIX cron behavior.
Changes:
- Adds explanation of OR vs AND behavior for day of month and day of week fields in the Gotchas section
- Provides concrete examples to illustrate the OR condition behavior
- References PR #877 for future extended cron syntax support using the
#character for patterns like "first Monday of the month"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
README.md
Outdated
| - `0 0 1-7 * 1` means "run at midnight on days 1-7 **OR** on any Monday", not "run on Mondays that fall within days 1-7". | ||
| - `0 0 15 * 5` means "run on the 15th of any month **OR** on any Friday". | ||
|
|
||
| If either field is set to `*` (unrestricted), the relationship becomes AND: |
There was a problem hiding this comment.
The phrase "the relationship becomes AND" is misleading. When one field is set to *, that field is unrestricted and doesn't impose any constraint - there's no AND relationship happening. The job simply matches based on the restricted field alone. Consider rephrasing to something like: "If either field is set to * (unrestricted), only the other field's constraint applies:"
| If either field is set to `*` (unrestricted), the relationship becomes AND: | |
| If either field is set to `*` (unrestricted), only the other field's constraint applies: |
Clarifies that when both fields are specified with specific values, they create an OR condition (not AND), following standard POSIX cron behavior. Also mentions the # character syntax being considered in kelektiv#877 as an alternative for patterns like "first Monday of the month". Closes kelektiv#890 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
a94d8ef to
cdaae2a
Compare
Summary
day of monthandday of weekfields are specified with specific values (not*), they create an OR condition (not AND), following standard POSIX cron behavior#character syntax being considered in feat: [435] add support for extended cron syntax #877 as an alternative for patterns like "first Monday of the month"Closes #890