-
Notifications
You must be signed in to change notification settings - Fork 625
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: added fractional offset support #685
Conversation
bug fixes modified test cases for minute support
f90cc68
to
bc21250
Compare
I've updated the PR title since this PR will introduce a breaking change: previously strings were parsed as minutes, now they would be parsed as "HH:mm" strings. |
Also, wanted to highlight here that previously also string behaviour worked fine, just minute support was not there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a few comments requesting some changes, otherwise lgtm 👍
oh my .. you're absolutely right, "magic" code right here .. the kind of hidden behaviors that I was talking about earlier, those can really be a real pain 🤦 especially since the doc clearly states:
so one might be tempted to use "30" for 30 minutes, then get an offset of 30 hours 🤣 |
Have done the changes and tested it. Let me know if documentation changes are required for string support. One thing to note is if we are adding string support, there will be cases where someone might put '330' as string offset where our code will take 330 hours as offset. I am thinking of handling this by using string as minutes in cases where : is not provided. What do you think? |
Thanks for your changes, and yes, please update the documentation to reflect your changes.
I think the best for now is to avoid introducing a breaking change in this PR, so we can release it on the v2 while we work on v3. I'll convert the codebase to Typescript soon, and I will be handling that issue at that time, which will then be released on v3 :) |
Well actually there's a breaking change since you removed the "magic" code I referenced earlier (treating What do you think about reintroducing that behaviour for now, so this PR contains no breaking change, then start working on another PR targeting the |
I ran the test pipeline for this PR, and there's some codestyle compliance issues. You can run |
Thank you for reviewing the PR in such a short time. I will be doing all the changes asked above. |
I took a look as well. good conversation and this PR is moving in a good direction. I just made one small suggestion |
We should definitely work on changing the dependence on local time zones for test cases in the future as it is very easy to miss edge cases. I checked your changes, Since only HH is supported in the string utcOffset, the test case does not support +xx:yy where yy is >0 and < 60. My timezone is 5:30 so the test case is not passing on my machine. |
good catch, I didn't put much effort into that test since it's going to be removed soon. I've reviewed and tested your changes, I'll merge your fork PR now. |
## [2.4.4](v2.4.3...v2.4.4) (2023-09-25) ### 🐛 Bug Fixes * added fractional offset support ([#685](#685)) ([ce78478](ce78478))
🎉 This PR is included in version 2.4.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [3.0.0-beta.5](v3.0.0-beta.4...v3.0.0-beta.5) (2023-09-25) ### 🐛 Bug Fixes * added fractional offset support ([#685](#685)) ([ce78478](ce78478))
🎉 This PR is included in version 3.0.0-beta.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [2.4.4](v2.4.3...v2.4.4) (2023-09-25) ### 🐛 Bug Fixes * added fractional offset support ([#685](#685)) ([ce78478](ce78478))
## [2.4.4](kelektiv/node-cron@v2.4.3...v2.4.4) (2023-09-25) ### 🐛 Bug Fixes * added fractional offset support ([kelektiv#685](kelektiv#685)) ([ce78478](kelektiv@ce78478))
## [2.4.4](kelektiv/node-cron@v2.4.3...v2.4.4) (2023-09-25) ### 🐛 Bug Fixes * added fractional offset support ([kelektiv#685](kelektiv#685)) ([ce78478](kelektiv@ce78478))
Description
This is a fix for Issue - #568
There was a stale pull request in the past but since it was not active, made a fresh PR with support for negative as well as positive offset with minute support - #685
Related Issue
Fixes #568.
Motivation and Context
It allows negative as well as positive offset with minute spport
How Has This Been Tested?
Tested in node 16.16.0, ran all the jet test cases and added 2 test cases where it was needed
Screenshots (if appropriate):
Types of changes
Checklist:
!
after the type/scope in the title (see the Conventional Commits standard).