Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse field for day of week should allow 0 or SUN values #366

Merged
merged 2 commits into from
Feb 19, 2025

Conversation

ruizmarc
Copy link
Contributor

Hi,

Currently expressions like: 0 0 3 * * SUN are crashing as SUN is parsed as 0 and when field parser checks for replacer existence, instead of checking explicitly for undefined values to throw an error it is checking for any no truthy expression. 0 is a valid value, but not a truthy. Just checking for explicit undefined values should solve the problem.

@harrisiirak harrisiirak self-requested a review February 19, 2025 14:47
@harrisiirak harrisiirak self-assigned this Feb 19, 2025
@harrisiirak
Copy link
Owner

Hi @ruizmarc!

Thanks for reporting this! It looks like a regression introduced by the latest patch release.

Fix looks good, but let's also add test case to verify that it's fixed.

using days of week strings test case is currently using named ranges, but ranges doesn't seem to be affected by this bug. Let's add a new test case that specifically asserts single named day usage.

Best regards

@ruizmarc
Copy link
Contributor Author

Done :)

@harrisiirak harrisiirak merged commit e0bda7e into harrisiirak:master Feb 19, 2025
6 checks passed
@harrisiirak
Copy link
Owner

Merged and published v5.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants