Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DayOfMonthField : 'LW' option !? #151

Closed
tomitomas opened this issue Oct 28, 2022 · 2 comments
Closed

DayOfMonthField : 'LW' option !? #151

tomitomas opened this issue Oct 28, 2022 · 2 comments

Comments

@tomitomas
Copy link

Hi Michael !

thanks for the repo, great job here !

I try to find out if I'm doing something wrong, or if the lib just doesn't handle the 'LW' combination option at the DayOfMonthField position.

like 0 10 LW * * stands for "At 10:00 AM, on the last weekday of the month"
but I've got an error "Uncaught Error: Call to a member function format() on bool in /var/www/html/vendor/dragonmantank/cron-expression/src/Cron/DayOfMonthField.php:51"

could you please confirm if LW works !?

@tomitomas
Copy link
Author

Hi @dragonmantank

any news please ? :)

@dragonmantank
Copy link
Owner

LW should validate properly.

$cron = new CronExpression('0 10 LW * *');
$this->assertTrue($cron->isDue(new \DateTimeImmutable('2023-08-31 10:00:00')));
$this->assertFalse($cron->isDue(new \DateTimeImmutable('2023-08-30 10:00:00')));

What version of the library, PHP, and OS are you using?

Since this is an older issue, I'm going to close this issue out, but feel free to re-open if you are still having the issue or have the above additional info.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants