Support expand_from_start_time#76
Closed
mghextreme wants to merge 1 commit intopallets-eco:masterfrom
Closed
Conversation
Collaborator
|
I do not reproduce your bug. |
Collaborator
|
(and even with currentDate+afewdays) |
Contributor
Author
What I'm proposing it's not a bugfix. In your example, you use the cron By using the parameter I proposed it would still consider a 7 day gap. So instead of |
Collaborator
|
Ok, i better understand. |
Collaborator
|
i manually merged your commits and made the neccessary changes, thx ! |
Collaborator
|
released as 2.0.6 |
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.
Issue
When unsing the library, we wanted to generate dates using the cron on a repeat (e.g. every 7 days with cron
0 0 */7 * *), but, even though we set thestart_time, the library just uses preset values to generate the possible dates.Code
A new parameter was added when creating a
croniterinstance -expand_from_start_time. WhenTrue, the expnaded values will be generated based on thestart_timedate set when creating the instance.Current behavior
0 0 */7 * *, start time today (2024-07-11):get_next()would generate 2024-07-15 (4 days from now) ❌New behavior
0 0 */7 * *, start time today (2024-07-11):get_next()would generate 2024-07-18 (7 days from now) ✅Important
Because the expanded values are generated when creating the
croniterinstance, usingexpand_from_start_time=Trueand settingstart_timeon theget_next()method is not supported.Changes
I made the initial changes, but wanted the opinion of the mantainers before moving forward with the changes.