Giter Club home page Giter Club logo

Comments (3)

joshuaquek avatar joshuaquek commented on May 31, 2024 1

To begin with, I would like to say that this is a great package, because I can't find any other nlp cron expression generator out there on npm that is as smart as this package.

However, one small downside is that the cron expressions generated somehow get flagged by crontab as a different meaning from what they should be.

After doing a quick search on google, there are a few crontab checkers to check if the cron expression is what you want it to be:

https://www.freeformatter.com/cron-expression-generator-quartz.html
https://cronexpressiondescriptor.azurewebsites.net/

As I mentioned earlier, when I try to do a cron expression for 'every hour between 5pm and 8pm' gives
* 17-20 * * ? * which is not the correct expression.

The correct cron expression for that should be 0 0 * 17-20 * ? *

from natural-cron.js.

onkar27 avatar onkar27 commented on May 31, 2024

Which format do you have for cron-expressions?

from natural-cron.js.

RathiRohit avatar RathiRohit commented on May 31, 2024

Hi @joshuaquek Thanks a lot, it feels great to know that you liked the package.

Regarding the issue,
The format you described (0 0 * 17-20 * ? *) contains 7 fields which means the first one is the seconds field. Right now this package doesn't have support for seconds field. So the generated expression has only 6 fields.

  1. Still your reported issue is correct and for every hour, the minutes field should be 0 instead of *.
    (We will resolve this issue in next update as early as possible)

  2. We will definitely add support for seconds field soon when we get time.

Also it looks like your required expression has some fields shuffled as compared to the default generated expression from this package. But you can easily change the generated cron expression format as per your need with optional second argument to the function call. Check out Flexible outputs section in README.

from natural-cron.js.

Related Issues (5)

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.