Skip to content

Incorrect description for 0 59 10 ? 1/2 MON#1 * #126

Open

Description

@maheshneogi

Actual result : at 10:59 every February months Monday 1 of every month

Expected Result : SOMETHING LIKE "The 1st Monday of every two months at 10:59"

Activity

  1. jmrozanec commented on Oct 14, 2016

    @jmrozanec
    Owner

    @maheshneogi thank you for reporting this - the description proposed looks much better :) Can we add a test case for this? I will be glad to accept the pull request. Thanks!

  2. fante76 commented on Nov 8, 2016

    @fante76

    It seems there is a problem with iterations syntax. I found same problem with:
    Expression: 0 15/4 12 * * ?
    Description: every 4 minutes at 12 hour
    Next start: Tue Nov 08 12:15:00 CET 2016

    "Next Start" is calculated using org.apache.logging.log4j.core.util.CronExpression

    The original code is:

    try {
        CronDescriptor cd = CronDescriptor.instance(Locale.ENGLISH);
        CronParser parser = new CronParser (CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ));
        final String cronExpression = "0 15/4 12 * * ?";
        Cron c = parser.parse(cronExpression);
        System.out.println("Expression:\t"+cronExpression);
        System.out.println("Description:\t"+cd.describe(c));
        CronExpression ce = new CronExpression(cronExpression);
        System.out.println("Next start:\t"+ce.getNextValidTimeAfter(new Date()));
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    
  3. jmrozanec commented on Nov 9, 2016

    @jmrozanec
    Owner

    @fante76 I agree. Currently I would need more time to come back with a better way to get descriptions. If you have ideas / proposals, I will be glad to discuss.

  4. fante76 commented on Nov 9, 2016

    @fante76

    As you, if I could catch some extra time I will get a look in to the code.

    Il 09/nov/2016 10:57, "jmrozanec" notifications@github.com ha scritto:

    @fante76 https://github.com/fante76 I agree. Currently I would need
    more time to come back with a better way to get descriptions. If you have
    ideas / proposals, I will be glad to discuss.

    —
    You are receiving this because you were mentioned.
    Reply to this email directly, view it on GitHub
    #126 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AMXOMAbhizgzErSRpVxosp2zErO07aZBks5q8ZkFgaJpZM4KWzce
    .

  5. Naxos84 commented on Nov 16, 2017

    @Naxos84
    Contributor

    So you are looking for something that is working like: https://www.freeformatter.com/cron-expression-generator-quartz.html ?

  6. jmrozanec commented on Nov 17, 2017

    @jmrozanec
    Owner

    @Naxos84 we are looking to get that quality level of descriptions, but with the flexibility that cron-utils can provide regarding parsing expressions. We created a specific milestone to tackle this improvement. Probably some major changes will be required. Any thoughts on this are appreciated!

  7. Naxos84 commented on Nov 17, 2017

    @Naxos84
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions