Code Monkey home page Code Monkey logo

Comments (4)

jmrozanec avatar jmrozanec commented on May 31, 2024

@AlexBes1 Thank you for reporting this. Will fix this as soon as possible.

from cron-utils.

RafaelAbreu05 avatar RafaelAbreu05 commented on May 31, 2024

Something strange happen when we define for example 0 0 12 13 1/2 ? * and the description should be
Day 13 of every 2 month(s) and the description is 'at 12:00 at 13 day every February months'.

I take a look and I think that the problem is in the every describe function:
The nominal value should not be calculated because is an every instance.

like every x months / days / years

/**

 * Provide a human readable description for Every instance
 * @param every - Every
 * @return human readable description - String
 */
protected String describe(Every every, boolean and) {
    String description;
    if (every.getPeriod().getValue() > 1) {
        description = String.format("%s %s ", bundle.getString("every"), nominalValue(every.getPeriod())) + " %p ";
    } else {
        description = bundle.getString("every")+" %s ";
    }
    if(every.getExpression() instanceof Between){
        Between between = (Between) every.getExpression();
        description += MessageFormat.format(
                bundle.getString("between_x_and_y"),
                nominalValue(between.getFrom()),
                nominalValue(between.getTo())
        )+" ";
    }
    return description;
}

from cron-utils.

jmrozanec avatar jmrozanec commented on May 31, 2024

@RafaelAbreu05 don't you mind checking this in a separate branch, and if works ok, send a pull request to fix the issue? Thanks!

from cron-utils.

jmrozanec avatar jmrozanec commented on May 31, 2024

@AlexBes1 @RafaelAbreu05 Fixed! Many thanks to @bertold for the fix!

from cron-utils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.