fix: weekday 7-to-0 conversion corrupting ranges#580
Merged
Conversation
The previous `expression.replace('7', '0')` ran as a plain string
replacement before range expansion, turning `5-7` (Fri-Sun) into `5-0`
which expanded to Sun-Fri (the opposite of what the user intended).
Move the 7-to-0 normalization to after range expansion and integer
parsing, operating on the numeric array instead of the raw string.
Also handles string tokens like `7L` (last Sunday) and deduplicates
when both 0 and 7 are present.
merencia
force-pushed
the
fix/weekday-7-range-corruption
branch
from
June 24, 2026 14:29
371b48a to
2928a41
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
expression.replace('7', '0')ran before range expansion, so5-7became5-0and expanded to the wrong days.Moved the 7-to-0 normalization to after range expansion, operating on the numeric array.
5-7[0,1,2,3,4,5][5,6,0]1-7[0,1][1,2,3,4,5,6,0]6-7[0,1,2,3,4,5,6][6,0]0-7[0][0,1,2,3,4,5,6]