Open bilogic opened 3 years ago
@dragonmantank would love to hear your opinions :)
@DerekCresswell what do you think? Thanks.
Sounds like an interesting addition to me. However, I don't think such a thing would be accepted. The maintainer of the repository considers it feature complete. So such a change is unlikely to be added. I would just say extend the class yourself and add this functionality to it.
@DerekCresswell
Thanks, I mistook you as the maintainer as only your name appeared when I looked through the recent commits.
@dragonmantank possible to say a yes or no? (preferrably yes 🤣)
Thanks for the suggestion.
As @DerekCresswell mentioned this library tries to stick to the original C implementation as much as possible, so I'm not sure I would add this. I will gladly leave open for others to see if they would like it though.
Thanks @dragonmantank
How do we vote?
I just leave it open for anyone else to chime in. I added the label to make it easier for people to find when looking through issues, because we have a few feature requests that are like this (might make life easier, but diverge from the original implementation).
@bilogic correct me if I am wrong but can't you not rewrite the code this way ?
$cron = new Cron\CronExpression('@quarterly');
echo $cron->getNextRunDate(null, 2)->sub(DateInterval::createFromDateString('7 days'))->format('Y-m-d H:i:s');
Seems to me that nothing needs to be added to the library to achieve what you are looking for 🤔 Or did I miss something ?
@nyamsprod
I can't remember my exact thought process, but I'm using this library via Laravel's schedule. I vaguely recall being able to expose an instance of this library, and thus wanted to be able to shift(...)
it so that when Laravel calls it's getNextRunDate()
, it gets the shifted date.
@nyamsprod I revisited this, this repo's isDue()
needs to return true for the shifted date. As far as I can tell, your code doesn't do that. Basically the shifting logic must be contained within getNextRunDate()
otherwise lots of code needs to be modified.
Hi,
shift()
and dependency on https://github.com/briannesbitt/Carbon