Add getRunDatesUntil method for generating multiple run dates until a specified end date - #201
Open
le-pepe wants to merge 4 commits into
Open
Add getRunDatesUntil method for generating multiple run dates until a specified end date#201le-pepe wants to merge 4 commits into
le-pepe wants to merge 4 commits into
Conversation
…ltiple execution dates until a specified end date test(CronExpressionTest.php): add unit tests for getRunDatesUntil method to ensure correct date calculations and edge case handling
…unDatesUntil method to ensure proper exception handling
… it is an integer test(CronExpressionTest.php): add unit test for invalid limit parameter in getRunDatesUntil method to ensure proper exception handling
mabar
reviewed
Feb 18, 2025
|
Looks like solution for #1, nice :) |
feat(CronExpression): add type hints to getRunDateUntil method parameters Co-authored-by: Marek Bartoš <bartos.developer152@gmail.com>
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.
Summary
A new
getRunDatesUntilmethod is added to generate execution dates based on a cron expression, limited by a specified end date. The method also allows setting a maximum number of iterations, including the current date, and handling time zones for date calculations.Details
$until), a maximum number of occurrences ($limit), and a reference time ($currentTime) to calculate the execution dates.$allowCurrentDate).determineTimeZonefunction to manage time zones, which can either be specified or dynamically determined from$currentTime.$limitparameter is set to 0, the method defaults to$this->maxIterationCount.Behavior
DateTimeInterfaceobjects representing the calculated execution dates.Tests
allowCurrentDateenabled and disabled.