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

CronExpression.getNextValidTimeAfter() yields incorrect result for last-day-of-month cron expressions #1298

Open
mma-ivu opened this issue Jan 8, 2025 · 2 comments

Comments

@mma-ivu
Copy link

mma-ivu commented Jan 8, 2025

This seems to be an issue introduced in release 2.5.0, likely with #1175 - "L" is not handled correctly for some months, e.g. February. A simple repro follows:

    @Test
    void testCronExpression() throws Exception {
        CronExpression cronExpression = new CronExpression("0 0 11 L * ?");
        Date nextValidTime = cronExpression.getNextValidTimeAfter(new Date(2017 - 1900, Calendar.FEBRUARY, 28, 5, 0));
        // nextValidTime should be the Feb 28, 2017, but instead is "Fri Mar 31 11:00:00 CEST 2017"
    }
@mma-ivu
Copy link
Author

mma-ivu commented Jan 8, 2025

Possibly / probably fixed with #1284 ?

@curegit
Copy link

curegit commented Jan 15, 2025

Possibly / probably fixed with #1284 ?

Yes. I fixed these cases in #1284 .

image

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

No branches or pull requests

2 participants