dragonmantank / cron-expression

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
MIT License
4.55k stars 121 forks source link

Last day of month (L) does not work in tandem with other days of month #189

Open glemoine-intouch opened 1 week ago

glemoine-intouch commented 1 week ago

Having trouble with this cron expression:

0 23 L,15 * *

This is a valid cron expression (Last day of the month AND 15th of the month), but is being validated as false by this line https://github.com/dragonmantank/cron-expression/blob/master/src/Cron/DayOfMonthField.php#L142

If you remove this line, it appears to work just fine, and produces next run dates as you'd expect. Any reason why this extra validation exists, and if not could it be removed and/or modified to allow expressions like the above to validate?