You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was messing with PHP 7.4.3 and v3.3.3 of the library and I'm not entirely sure if i'm doing something wrong or if the calculation is broken.
If i use the cron-expression 0 5 LW * * to calculate 5:00 at the last weekday of the month and then execute getNextRunDate('2023-10-01 00:00:00') I would expect this function to return 2023-10-31 05:00:00 but it returns 2023-10-02 05:00:00.
If i change it to getNextRunDate('2023-10-03 00:00:00') the result changes to 2023-12-30 05:00:00.
Is this a bug or did I misunderstand how LW is supposed to work?
The text was updated successfully, but these errors were encountered:
* 'L' stands for "last". It allows you to specify constructs such as
* "the last Friday" of a given month.
I guess it means last wednesday and not last weekday as in Quartz Scheduler (in which I found this feature, is it also somewhere else?)
Even with that in mind, it looks like a bug, because it does not match last wednesday. Also it is not a standard cron syntax and it's better to not use it.
I was messing with PHP 7.4.3 and v3.3.3 of the library and I'm not entirely sure if i'm doing something wrong or if the calculation is broken.
If i use the cron-expression
0 5 LW * *
to calculate5:00 at the last weekday of the month
and then executegetNextRunDate('2023-10-01 00:00:00')
I would expect this function to return2023-10-31 05:00:00
but it returns2023-10-02 05:00:00
.If i change it to
getNextRunDate('2023-10-03 00:00:00')
the result changes to2023-12-30 05:00:00
.Is this a bug or did I misunderstand how LW is supposed to work?
The text was updated successfully, but these errors were encountered: