Skip to content

Commit

Permalink
refactor: switching from cron to cron-parser (#16)
Browse files Browse the repository at this point in the history
* change cron to cron-parser

* fix Promise typings
BREAKING CHANGE: Switching from [ncb000gt/node-cron](https://www.npmjs.com/package/cron) to [harrisiirak/cron-parser](https://www.npmjs.com/package/cron-parser) for cron-pattern parsing.

    Previously month was 0-based (0=January). Going forward standard Unix pattern is used, which is 1-based (1=January).

    Please update existing cron-patterns that specify a month (4th position of a pattern). The month is now 1 - 12

    1 = January

    2 = February

    3...

    | Example | Execute on 1st of January |
    |---------|---------------------------|
    | Old     | 0 0 1 **0** *             |
    | New     | 0 0 1 **1** *             |

    old Cron patterns

    ```
    * * * * * *
    | | | | | |
    | | | | | +-- Year              (range: 1900-3000)
    | | | | +---- Day of the Week   (range: 1-7, 1 standing for Monday)
    | | | +------ Month of the Year (range: 0-11) NOTE: Difference here
    | | +-------- Day of the Month  (range: 1-31)
    | +---------- Hour              (range: 0-23)
    +------------ Minute            (range: 0-59)
    ```

    new cron patterns

    ```
    * * * * * *
    | | | | | |
    | | | | | +-- Year              (range: 1900-3000)
    | | | | +---- Day of the Week   (range: 1-7, 1 standing for Monday)
    | | | +------ Month of the Year (range: 1-12) NOTE: Difference here
    | | +-------- Day of the Month  (range: 1-31)
    | +---------- Hour              (range: 0-23)
    +------------ Minute            (range: 0-59)
    ```

Co-authored-by: Aras Abbasi <a.abbasi@cognigy.com>
  • Loading branch information
Uzlopak and Aras Abbasi committed Dec 6, 2020
1 parent 6fd7a9f commit e5c3bf1
Show file tree
Hide file tree
Showing 7 changed files with 10,614 additions and 192 deletions.

0 comments on commit e5c3bf1

Please sign in to comment.