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

fix: Sundays can begin weekday ranges #320

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

tehpsalmist
Copy link
Contributor

This PR fixes a bug where weekday ranges starting with sun would incorrectly throw an out of order error.

For example:

parseCronExpression('00 12 * * Sun-wed,fri')
// Throws -- parse error: Error: Failed to parse Sun-wed: Invalid range (start: 7, end: 3).

Tests were also updated to check for:

  1. the case outlined above, and
  2. to ensure that sun-sun was not treated as a full week range, but only as a single day. I couldn't find the spec for this, but instead very scientifically tried it out at crontab.guru to see what it would yield.

@P4sca1
Copy link
Owner

P4sca1 commented Jul 29, 2024

Hey @tehpsalmist,
thank you for your contribution and for also including additional test cases. I will review asap.

Copy link
Owner

@P4sca1 P4sca1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, LGTM!

@P4sca1 P4sca1 changed the title Bug fix: Sundays can begin weekday ranges fix: Sundays can begin weekday ranges Jul 29, 2024
@P4sca1 P4sca1 merged commit 1cce462 into P4sca1:main Jul 29, 2024
2 checks passed
@P4sca1
Copy link
Owner

P4sca1 commented Jul 29, 2024

🎉 This issue has been resolved in version 5.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@tehpsalmist
Copy link
Contributor Author

Thanks for the quick review and release! Have a blessed week!

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