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

Added a method to get run dates in a date range #41

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

3p3r
Copy link

@3p3r 3p3r commented Nov 30, 2013

Added a method to get run dates in a date range and some minor optimizations.

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
Copy link

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

@3p3r
Copy link
Author

3p3r commented Dec 1, 2013

Fixed input type in comments. Thanks @staabm

@mtdowling
Copy link
Owner

I like this feature. Can you add tests please?

$guard = $this->getNextRunDate($start, 0, true);
$guard <= $end;
$guard = $this->getNextRunDate($guard, 0, false)
)
Copy link
Owner

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

Copy link
Author

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.
@3p3r
Copy link
Author

3p3r commented Dec 5, 2013

@mtdowling I will add tests too but with a couple of days delay. Sorry for that but it is my finals' week at school.

@viktoras25 viktoras25 mentioned this pull request Apr 24, 2014
@ghost
Copy link

ghost commented Nov 18, 2014

This is a really needed functionality.

peter279k pushed a commit to peter279k/cron-expression that referenced this pull request Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants