-
Notifications
You must be signed in to change notification settings - Fork 338
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
Added a method to get run dates in a date range #41
base: master
Are you sure you want to change the base?
Conversation
getRangeRunDates returns all run dates limited to a date range.
max(0, $total) doesn't need to be calculated in every iteration.
/** | ||
* Get ALL run dates limited to a date range | ||
* | ||
* @param string|DateTime $start Start of range |
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.
null|string|DateTime
, same for line below
Fixed input type in comments. Thanks @staabm |
I like this feature. Can you add tests please? |
$guard = $this->getNextRunDate($start, 0, true); | ||
$guard <= $end; | ||
$guard = $this->getNextRunDate($guard, 0, false) | ||
) |
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.
Can you add braces here? I don't like blocks without a wrapping brace
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.
Done :)
"cleaner code" by re aligning some comments and adding braces.
@mtdowling I will add tests too but with a couple of days delay. Sorry for that but it is my finals' week at school. |
This is a really needed functionality. |
…able Support DateTimeImmutable
Added a method to get run dates in a date range and some minor optimizations.