Skip to content

Document overnight range semantics - #4

Merged
umputun merged 1 commit into
masterfrom
docs/overnight-semantics
Aug 19, 2026
Merged

umputun merged 1 commit into
masterfrom
docs/overnight-semantics

Conversation

@paskal

@paskal paskal commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

An overnight range combined with non-wildcard calendar fields does not produce the continuous window it looks like. Each rule is evaluated against a single calendar day, and dow, dom and month are matched against the day shown on the clock, so 23:00-02:00 1 * * matches Monday 00:00-02:00 and Monday 23:00 to midnight, and it does not match Tuesday 00:30. Nothing in the readme or the package doc said so, and the only overnight example used wildcards, where the behaviour is the obvious one.

The readme gains an "Overnight Ranges" section and the package doc a matching paragraph, both stating the rule and showing the two-rule form for a window that really does run from Monday evening into Tuesday morning:

23:00-23:59:59 1 * *;00:00-02:00 2 * *

Table cases pin both: the per-day evaluation in TestMatches, and the split form with its boundaries in TestMatch.

Documentation and tests only, rule.go is untouched and there is no behaviour change.

An overnight range combined with non-wildcard calendar fields does not
produce the continuous window it looks like: `23:00-02:00 1 * *` matches
Monday 00:00-02:00 and Monday 23:00 to midnight, because each rule is
evaluated against a single calendar day and dow, dom and month are matched
against the day shown on the clock.

The readme and the package doc now spell that out and show the two-rule
form for a window that really does run from Monday evening into Tuesday
morning. Table cases pin both. No behaviour change.
@paskal
paskal requested a review from umputun as a code owner August 19, 2026 05:50
@umputun
umputun merged commit 88d7a81 into master Aug 19, 2026
4 checks passed
@umputun
umputun deleted the docs/overnight-semantics branch August 19, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants